博客
关于我
18.对象方法的扩展
阅读量:398 次
发布时间:2019-03-05

本文共 693 字,大约阅读时间需要 2 分钟。

对象方法扩展

//1. Object.is 判断两个值是否完全相等 console.log(Object.is(120, 120));// === console.log(Object.is(NaN, NaN));// === console.log(NaN === NaN);// ===         //2. Object.assign 对象的合并const config1 = {    host: 'localhost',    port: 3306,    name: 'root',    pass: 'root',    test: 'test'};const config2 = {    host: 'http://atguigu.com',    port: 33060,    name: 'atguigu.com',    pass: 'iloveyou',    test2: 'test2'}console.log(Object.assign(config1, config2));//3. Object.setPrototypeOf 设置原型对象  Object.getPrototypeofconst school = {    name: 'study'}const cities = {    xiaoqu: ['北京','上海','深圳']}Object.setPrototypeOf(school, cities);console.log(Object.getPrototypeOf(school));console.log(school);

转载地址:http://mmazz.baihongyu.com/

你可能感兴趣的文章
mysql经常使用命令
查看>>
MySQL经常使用技巧
查看>>
mysql给账号授权相关功能 | 表、视图等
查看>>
MySQL缓存使用率超过80%的解决方法
查看>>
Mysql缓存调优的基本知识(附Demo)
查看>>
mysql编写存储过程
查看>>
mysql网站打开慢问题排查&数据库优化
查看>>
mysql网络部分代码
查看>>
mysql联合索引 where_mysql联合索引与Where子句优化浅析
查看>>
mysql联合索引的最左前缀匹配原则
查看>>
mysql自动化同步校验_Shell: 分享MySQL数据同步+主从复制自动化脚本_20190313_七侠镇莫尛貝...
查看>>
Mysql自增id理解
查看>>
mysql自增id超大问题查询
查看>>
MySQL自定义变量?学不废不收费
查看>>
MySQL自带information_schema数据库使用
查看>>
MySQL获取分组后的TOP 1和TOP N记录
查看>>
mysql虚拟列表_动态网页制作-官方版合集下载-多特
查看>>
MySQL蜜罐反制获取攻击者信息
查看>>
Mysql表创建外键报错
查看>>
mysql表格调取数据库信息_MySQL™ 参考手册(获取有关数据库和表的信息)
查看>>