javascript 对象

var myDog = {
"name":"aaa",
"legs":5,
"tails":20,
"friends": ["sss","ddd"]

 };

 

var testObj = {
"hat": "ballcap",
"shirt": "jersey",
"shoes": "cleats"
};

var hatValue = testObj.hat;
var shirtValue = testObj.shirt;

 

 

var testObj = {
"an entree": "hamburger",
"my side": "veggies",
"the drink": "water"
};

var entreeValue=testObj["an entree"]; 
var drinkValue=testObj["the drink"];

posted on 2018-04-10 21:26  HopeWu  阅读(80)  评论(0编辑  收藏  举报

导航