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

Function toLength

lib/web/polyfill.js:307–309  ·  view source on GitHub ↗
(it)

Source from the content-addressed store, hash-verified

305}
306// 7.1.15 ToLength
307function toLength(it){
308 return it > 0 ? min(toInteger(it), MAX_SAFE_INTEGER) : 0;
309}
310function toIndex(index, length){
311 var index = toInteger(index);
312 return index < 0 ? max(index + length, 0) : min(index, length);

Callers 3

createArrayMethodFunction · 0.85
createArrayContainsFunction · 0.85
polyfill.jsFile · 0.85

Calls 2

minFunction · 0.85
toIntegerFunction · 0.85

Tested by

no test coverage detected