|
@@ -29,7 +29,7 @@
|
|
// console.log(Object.setPrototypeOf(obj3,arr));
|
|
// console.log(Object.setPrototypeOf(obj3,arr));
|
|
// h5 => localStorage 中的 setItem 和 getItem
|
|
// h5 => localStorage 中的 setItem 和 getItem
|
|
// 3.Object.setPrototypeOf 自定义对象设置属性
|
|
// 3.Object.setPrototypeOf 自定义对象设置属性
|
|
- let newObj = Object.setPrototypeOf(arr,obj3);
|
|
|
|
|
|
+ let newObj = Object.setPrototypeOf(obj3,arr);
|
|
// 4.Object.getPrototypeOf 读取自定义对象属性
|
|
// 4.Object.getPrototypeOf 读取自定义对象属性
|
|
console.log(Object.getPrototypeOf(newObj))
|
|
console.log(Object.getPrototypeOf(newObj))
|
|
|
|
|
|
@@ -44,7 +44,7 @@
|
|
console.log(Object.entries(obj4),'entries');
|
|
console.log(Object.entries(obj4),'entries');
|
|
// 7.Object.values() 返回当前对象中可枚举的属性值
|
|
// 7.Object.values() 返回当前对象中可枚举的属性值
|
|
console.log(Object.values(obj4),'values');
|
|
console.log(Object.values(obj4),'values');
|
|
-
|
|
|
|
|
|
+
|
|
</script>
|
|
</script>
|
|
</body>
|
|
</body>
|
|
</html>
|
|
</html>
|