const person = {
fullName: "Tsuyu Naruhito",
sayName: function() {
// `person.fullName`と書いているのと同じ
return this.fullName;
}
};
// `person.fullName`を出力する
console.log(person.sayName()); // => "Tsuyu Naruhito"
//thisはベースオブジェクトを参照するというルールは同じです。
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.