Secrets of the JavaScript Ninja SEの内容メモ
Secrets of the JavaScript Ninja にはES6対応版のSecond Editionが存在するが、翻訳はされていない。
Second Editionを読んでいるので、内容について軽くメモしておく。
※一通り網羅ではなく、めぼしい所をメモする
cp1. JavaScript is everywhere
cp2. Building the page at runtime
Webページのライフサイクル
ページ構築フェーズ、イベントハンドリングフェーズ
cp3. First-class functions for the novice: definitions and arguments
関数がfirst-class objectであるという事
objectと同様に扱える
リテラルで作成できる
変数に代入できる
プロパティを所有できる
引数として渡せる
戻り値として返せる
プロパティを所有できるケースの実例
関数の貯蔵
メモ化
関数の定義方法グループ
残余引数、デフォルトパラメータ
cp4. Functions for the journeyman: understanding function invocation
argumentsパラメータ
配列風だが、配列ではない(Array.prototypeのMethodが使えない)
strict modeで無効化される機能
function context