【 Javascript 】自學筆記(二)
1. var snoopy = new Object(){ snoopy.species = "beagle", snoopy.age = 10 }; var species = snoopy.species; var age = snoopy["age"]; => 兩種取值的方式 2. function和物件宣告的方式差別的地方: function: function Person (job, age) { this.job = "student"; this.age = 20; } =>在function裡的key都是用分號分開的 Object: var james = { ...