MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / createArrayContains

Function createArrayContains

lib/web/polyfill.js:269–280  ·  view source on GitHub ↗
(isContains)

Source from the content-addressed store, hash-verified

267 }
268}
269function createArrayContains(isContains){
270 return function(el /*, fromIndex = 0 */){
271 var O = toObject(this)
272 , length = toLength(O.length)
273 , index = toIndex(arguments[1], length);
274 if(isContains && el != el){
275 for(;length > index; index++)if(sameNaN(O[index]))return isContains || index;
276 } else for(;length > index; index++)if(isContains || index in O){
277 if(O[index] === el)return isContains || index;
278 } return !isContains && -1;
279 }
280}
281function generic(A, B){
282 // strange IE quirks mode bug -> use typeof vs isFunction
283 return typeof A == 'function' ? A : B;

Callers 1

polyfill.jsFile · 0.85

Calls 4

toLengthFunction · 0.85
toIndexFunction · 0.85
sameNaNFunction · 0.85
toObjectFunction · 0.70

Tested by

no test coverage detected