博客
关于我
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分表后同结构不同名称表之间复制数据以及Update语句只更新日期加减不更改时间
查看>>
Mysql基础命令 —— 系统操作命令
查看>>
mysql备份
查看>>
mysql备份与恢复
查看>>
MySQL外键约束
查看>>
MySQL多表关联on和where速度对比实测谁更快
查看>>
mysql大批量删除(修改)The total number of locks exceeds the lock table size 错误的解决办法
查看>>
MySQL如何实现ACID ?
查看>>
mysql存储登录_php调用mysql存储过程会员登录验证实例分析
查看>>
MySQL存储过程入门
查看>>
mysql存储过程批量建表
查看>>
mysql存储过程详解
查看>>
MySQL学习-group by和having
查看>>
MySQL学习-MySQL条件查询
查看>>
MySQL学习-子查询及limit分页
查看>>
MySQL学习-排序与分组函数
查看>>
MySQL学习-连接查询
查看>>
Mysql学习总结(21)——MySQL数据库常见面试题
查看>>