4. JSã®ãªãã¸ã§ã¯ã㯠é£æ³é åã¿ãããªãã® 1 // 空ã®ãªãã¸ã§ã¯ããä½æ 2 var dog = {}; 3 4 // ããããã£ãã²ã¨ã¤è¿½å 5 dog.name = "Pochi"; 6 7 // ãã©ã±ããã§ãã¢ã¯ã»ã¹ã§ãã 8 dog['breed'] = "Shih Tzu"; 9 10 // é¢æ°ãã²ã¨ã¤è¿½å -> ã¡ã½ãã 11 dog.getBreed = function () { 12 return this.breed; 13 } 5. JSã®ãªãã¸ã§ã¯ã㯠é£æ³é åã¿ãããªãã® 1 // åããã®ããªãã¸ã§ã¯ããªãã©ã«ã§è¡¨è¨ 2 var dog = { 3 name: "Pochi", 4 breed: "Shih Tzu", 5 getBreed: function () { 6 return this.breed; 7 } 8 }; 6. ã¯ã©ã¹ã£ã½ã
{{#tags}}- {{label}}
{{/tags}}