摘要: if (!String.prototype.includes) { String.prototype.includes = function(search, start) { 'use strict'; if (typeof start !== 'number') { start = 0; } if 阅读全文
posted @ 2016-04-28 08:12 shidengyun 阅读(182) 评论(0) 推荐(0) 编辑
摘要: if (!Array.prototype.includes) { Array.prototype.includes = function(searchElement /*, fromIndex*/ ) { 'use strict'; var O = Object(this); var len = p 阅读全文
posted @ 2016-04-28 08:09 shidengyun 阅读(201) 评论(0) 推荐(0) 编辑
摘要: // --file.js--function getJSON(url, callback) { let xhr = new XMLHttpRequest(); xhr.onload = function () { callback(this.responseText) }; xhr.open("GE 阅读全文
posted @ 2016-04-27 15:16 shidengyun 阅读(224) 评论(0) 推荐(0) 编辑
摘要: /* * object.watch polyfill * * 2012-04-03 * * By Eli Grey, http://eligrey.com * Public Domain. * NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RIS 阅读全文
posted @ 2016-04-27 09:46 shidengyun 阅读(351) 评论(0) 推荐(0) 编辑
摘要: obj1 = { internal: {}};Object.freeze(obj1);obj1.internal.a = 'aValue';obj1.internal.a // 'aValue'// To make obj fully immutable, freeze each object in 阅读全文
posted @ 2016-04-27 09:21 shidengyun 阅读(196) 评论(0) 推荐(0) 编辑
摘要: const reduce = Function.bind.call(Function.call, Array.prototype.reduce);const isEnumerable = Function.bind.call(Function.call, Object.prototype.prope 阅读全文
posted @ 2016-04-27 09:14 shidengyun 阅读(537) 评论(0) 推荐(0) 编辑
摘要: function defineProperties(obj, properties){ function convertToDescriptor(desc) { function hasProperty(obj, prop) { return Object.prototype.hasOwnPrope 阅读全文
posted @ 2016-04-27 08:55 shidengyun 阅读(643) 评论(0) 推荐(0) 编辑
摘要: // Create a new object, that prototypally inherits from the Error constructor.function MyError(message) { this.name = 'MyError'; this.message = messag 阅读全文
posted @ 2016-04-26 20:04 shidengyun 阅读(97) 评论(0) 推荐(0) 编辑
摘要: var SimplePropertyRetriever = { getOwnEnumerables: function (obj) { return this._getPropertyNames(obj, true, false, this._enumerable); // Or could use 阅读全文
posted @ 2016-04-22 13:04 shidengyun 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 时间 2016-04-20 13:00:03 好JSER 相似文章 (1)原文 http://hao.jser.com/archive/10183/主题 JavaScript 时间 2016-04-20 13:00:03 好JSER 相似文章 (1) 原文 http://hao.jser.com/a 阅读全文
posted @ 2016-04-21 09:57 shidengyun 阅读(239) 评论(0) 推荐(0) 编辑