1.对象
<script> let name = { user: "jim", age: 34 }; //name即为创建的对象,后面可以直接调用 console.log(name.age) console.log(name.user) name.user = "devid" name.get = function(){ return `${this.user}'s' age is ${this.age}`; //this代表对象内容 } console.log(name.get()) </script>
标签:console,name,get,age,object,js,user,log From: https://www.cnblogs.com/JASON-yul/p/16785834.html