Open a Haus Account, and get instant access to your equity, plus lower monthly payments.
Open a Haus Account, and get instant access to your equity, plus lower monthly payments.
Note: PureRenderMixin is a legacy add-on. Use React.PureComponent instead. Importing import PureRenderMixin from 'react-addons-pure-render-mixin'; // ES6 var PureRenderMixin = require('react-addons-pure-render-mixin'); // ES5 with npm Overview If your React component’s render function renders the same result given the same props and state, you can use this mixin for a performance boost in some cas
Array.prototype.keysはIteratorを返すのでArray.fromに食わせる Array.from(Array(5).keys()); //=> [0, 1, 2, 3, 4] もしくは Array.from({ length: 5 }).map((v, k) => k); //=> [0, 1, 2, 3, 4] Array.fromの第二引数はmap的な役割があるので Array.from({ length: 5 }, (v, k) => k); //=> [0, 1, 2, 3, 4] こんな感じ。 [追記] 便利。 ES6でN個の配列 - hokaccha hamalog v3[es2015][js] これでも行ける -> [...Array(5).keys()];2016/04/18 11:42 b.hatena.ne.jp
ES2015でvarやletを使う場面はほとんど無いので、まずconstを使う。constだとダメな場合にはletを使う。 背景 ES2015では、変数を宣言するための文法としてconstとletが導入された。 const foo = 'foo'; let bar = 'bar'; constは再代入できない変数を宣言できる。letは再代入できる変数を宣言できる。 const foo = 'foo'; foo = 'hoge'; // ERROR let bar = 'bar'; bar = 'hoge'; // OK あれ、じゃあvarとletは同じなの?っていうとそうではなく、letやconstはvarとは違って、関数スコープよりも細かなブロック単位のスコープを提供する。例えばconstやletを使うと、if文やfor文などのブロック中でのみ有効な変数を宣言できる。 で、プロジェクトに
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く