1. objects定义
const myObj = {
myName: "yuxian",
age: 21,
}
console.log(myObj);
2.Objects操作函数
2.1 直接取出元素
const myObj = {
myName: "yuxian",
age: 21,
}
console.log(myObj);
console.log(myObj.myName);
console.log(myObj['myName']);
2.3 添加元素
const myObj = {
myName: "yuxian",
age: 21,
}
myObj.location = 'anhui';
console.log(myObj);
原创文章,作者:306829225,如若转载,请注明出处:https://blog.ytso.com/272353.html