摘要: Object.is = Object.is || function(x,y){ if(x y){ return x !== 0 || 1 / x 1 / y } return x !== x && y !== y } 解决: 第一个return:0、+0与-0比较的问题; 第二个return:NaN 阅读全文
posted @ 2020-08-12 23:05 671_MrSix 阅读(124) 评论(0) 推荐(0) 编辑
摘要: function constantize(obj){ Object.freeze(obj) Object.keys(obj).forEach(key => { if(typeof obj[key] == 'object'){ constantize(obj[key]) } }) return obj 阅读全文
posted @ 2020-08-12 15:28 671_MrSix 阅读(96) 评论(0) 推荐(0) 编辑