Make it to make it

いろいろ作ってアウトプットするブログ

2019-08-03から1日間の記事一覧

this: new binding, window binding

new binding /** * new Binding */ const Animal = function(color, name, type) { this.color = color this.name = name this.type = type } const zebra = new Animal('black and white', 'shimauma', 'plant-eating animal') console.log(zebra) 下記のよ…

this: Implicit binding / Explicit binding

Implicit binding 次のようなファクトリーファンクションがあるとする。 いわゆる実行時にオブジェクトを返却するファンクション。 /** * Implicit Binding * Left of the dot at call time */ const Person = function(name, age) { return { name, age, sa…