タグ

2015年10月5日のブックマーク (2件)

  • Class構文について - JS.next

    概要 待ち焦がれた人も多いことだろう。ES2015の一番の目玉機能とも言えるクラス構文が、ついにV8でサポートされた。 Class構文は、『関数(コンストラクタ)定義』+『.prototypeへのメソッド定義』の糖衣構文である。 JSで今まで様々に工夫されてきたクラスの書き方を、綺麗に統一してくれる可能性を秘めている。 クラスを作る 従来、Catクラスを作ろうとした場合このように書いてきた。 function Cat(name) { this.name = name } Cat.prototype.meow = function () { alert( this.name + 'はミャオと鳴きました' ) } しかしこの書き方だとどうしても、コンストラクタとメソッドの定義が分離されているため、クラスとしてまとまりがなく分かりづらく感じる。 メソッドが増えてきた時も、Cat.prototyp

    Class構文について - JS.next
  • Explore the Genealogy of Nike Free interactive experience.

    Part sandal, part running tight and introduced in a bumblebee color scheme, the Nike Sock Racer wasn't your average shoe. It was inspired by Bill Bowerman’s mandate to strip away all unnecessary elements of a running shoe and honed to act as an extension of the foot. Still, no one expected this ultralight racing flat to make the impact it did, but it became an instant favourite of marathon runners

    Explore the Genealogy of Nike Free interactive experience.