script> /* 解构 1.左边读取的字段,右手边必须有 2.读取的是右手边的一个层级 */ var obj={ name:"ming",age:18,skill:"html", s:{ sex:"女" } }; //var name=obj.name; //var age=obj.age; //var skill=obj.skill; var {name,age,s}=obj; console.log(name); console.log(s.sex); </script>