タグ

2015年10月23日のブックマーク (3件)

  • new Array()と[]の違い - Qiita

    JavaScriptで配列を生成するにはコンストラクタ new Array() とリテラル [] の二つがあるので違いをまとめておく。 個人的には、簡潔で読みやすいので、なるべく [] を使うべきだと思っている。 機能面での違い どちらも配列オブジェクトを生成する。 ただし、整数を一つだけ渡した際の挙動が異なる。 new Array(3) はlengthが3の配列を生成する。中身は0から2まですべてundefinedになっている。 [3] は要素をひとつだけ含む配列を生成する。 console.log( new Array(1,2,3) ); //1,2,3 console.log( [1,2,3] ); //1,2,3 console.log( new Array(3) ); //undefined, undefined, undefined console.log( [3] ); //

    new Array()と[]の違い - Qiita
  • Cling

    What is Cling Cling is an interactive C++ interpreter, built on the top of LLVM and Clang libraries. Its advantages over the standard interpreters are that it has command line prompt and uses just-in-time (JIT) compiler for compilation. Many of the developers (e.g. Mono in their project called CSharpRepl) of such kind of software applications name them interactive compilers. One of Cling’s main go

    Cling
    masterq
    masterq 2015/10/23
    "Cling is an interactive C++ interpreter, built on the top of LLVM and Clang libraries."
  • Arrayの基礎知識と各メソッドの使用方法 - Qiita

    new Array(1, 2, 3); // [1, 2, 3] [1, 2, 3]; // [1, 2, 3] - 配列リテラルの利用 new Array('1'); // ['1'] new Array(5); // [undefined x 5] - 要注意!要素数として扱われる // ※ http://qiita.com/sh19910711/items/3c0776fd8cc1797f955d#comment-2a70b836f3015c467f5e var list = [ 1, 2, 3, 4, 5, 6 ]; // 現在の要素数より小さな値を指定すると配列は切り詰められる。 list.length = 3; list; // [1, 2, 3] // 元に戻すと元々あった部分は削除されている。 list.length = 6; list; // [1, 2, 3, unde

    Arrayの基礎知識と各メソッドの使用方法 - Qiita
    masterq
    masterq 2015/10/23
    こんなところから勉強だなぁ。。。