摘要: Object.create()方法创建一个新对象,使用现有的对象来提供新创建的对象的__proto__。 Object.create(proto[, propertiesObject]) 参数 proto 新创建对象的原型对象。 propertiesObject 可选。如果没有指定为 undefin 阅读全文
posted @ 2020-05-21 09:46 honely1314 阅读(167) 评论(0) 推荐(0) 编辑
摘要: Object.assign() 方法用于将所有可枚举属性的值从一个或多个源对象复制到目标对象。它将返回目标对象。 const target = { a: 1, b: 2 ,c:3,e:6}; const source = { b: 4, c: 5 }; const returnedTarget = 阅读全文
posted @ 2020-05-21 09:24 honely1314 阅读(188) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <style> .img{ width: 450px; height: 300px; display: blo 阅读全文
posted @ 2020-05-21 08:50 honely1314 阅读(322) 评论(0) 推荐(0) 编辑