摘要: function myTypeof(val){ var type = typeof(val); var myString = Object.prototype.toString; var res = { '[object Object]' : 'object', '[object Array]' : 'array', '[... 阅读全文
posted @ 2019-02-09 17:54 阿|明 阅读(269) 评论(0) 推荐(0) 编辑
摘要: var obj = { '2' : 3, '3' : 4, 'length' : 2, 'splice' : Array.prototype.splice, 'push' : Array.prototype.push }; obj.push(1); obj.push(2); console.log(obj) // [empty × 2, 1, 2, ... 阅读全文
posted @ 2019-02-09 00:15 阿|明 阅读(160) 评论(0) 推荐(0) 编辑