by
15
7
235k
1
Top 1% !
Popular
Pearl of Wisdom
Nice
Easy-to-find
Specified
MultiPlatform
Popularity: 6071st place
Languagejavascript
LicenseMIT_X11

ES5 Array funKtion polly-fillerz...

just in case your browser sucks
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/234365/ES5-Array-funKtion-polly-fillerz---?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
// filler for Array.prototype.bind() if (!Function.prototype.bind) { Function.prototype.bind = function(that) { if (typeof this !== 'function') { throw new TypeError('obj is not callable'); } var a_Argz = Array.prototype.slice.call(arguments, 1), noop = function() {}, bFnky = this, bnd = function() { return bFnky.apply(this instanceof noop && that? this: that, a_Argz.concat(Array.prototype.slice.call(arguments))); }; noop.prototype = this.prototype; bnd.prototype = new noop(); return bnd; }; } // different approach for isArray()... function isArray (list) { } if (!Array.isArray) { Array.isArray = function(argz) { return Object.prototype.toString.call(argz) === '[object Array]'; }; } function isArray (list) { if (Array.isArray) { return Array.isArray(list); } } function isArray (list) { if (Array.isArray) { return Array.isArray(list); } return Object.prototype.toString.call(list) === '[object Array]'; } var isArray; var isArray = (function () { })(); var isArray = (function () { if (Array.isArray) { return Array.isArray; } })(); var isArray = (function () { if (Array.isArray) { return Array.isArray; } return function (list) { return Object.prototype.toString.call(list) === '[object Array]'; }; })(); function (list) { return Object.prototype.toString.call(list) === '[object Array]'; }
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus