博客
关于我
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之IN 和 Exists 用法
查看>>
MYSQL之REPLACE INTO和INSERT … ON DUPLICATE KEY UPDATE用法
查看>>
MySQL之SQL语句优化步骤
查看>>
MYSQL之union和order by分析([Err] 1221 - Incorrect usage of UNION and ORDER BY)
查看>>
Mysql之主从复制
查看>>
MySQL之函数
查看>>
mysql之分组查询GROUP BY,HAVING
查看>>
mysql之分页查询
查看>>
Mysql之备份与恢复
查看>>
mysql之子查询
查看>>
MySQL之字符串函数
查看>>
mysql之常见函数
查看>>
Mysql之性能优化--索引的使用
查看>>
mysql之旅【第一篇】
查看>>
Mysql之索引选择及优化
查看>>
mysql之联合查询UNION
查看>>
mysql之连接查询,多表连接
查看>>
mysql乐观锁总结和实践 - 青葱岁月 - ITeye博客
查看>>
mysql也能注册到eureka_SpringCloud如何向Eureka中进行注册微服务-百度经验
查看>>
mysql乱码
查看>>