MCPcopy
hub / github.com/stemkoski/stemkoski.github.com / slice

Function slice

MathBox/mathbox-bundle.js:35540–35553  ·  view source on GitHub ↗

* Slices the `collection` from the `start` index up to, but not including, * the `end` index. * * Note: This function is used instead of `Array#slice` to support node lists * in IE < 9 and to ensure dense arrays are returned. * * @private * @param {Array|Object|string} collectio

(array, start, end)

Source from the content-addressed store, hash-verified

35538 * @returns {Array} Returns the new array.
35539 */
35540 function slice(array, start, end) {
35541 start || (start = 0);
35542 if (typeof end == 'undefined') {
35543 end = array ? array.length : 0;
35544 }
35545 var index = -1,
35546 length = end - start || 0,
35547 result = Array(length < 0 ? 0 : length);
35548
35549 while (++index < length) {
35550 result[index] = array[start + index];
35551 }
35552 return result;
35553 }
35554
35555 /*--------------------------------------------------------------------------*/
35556

Callers 15

boundFunction · 0.85
baseCloneFunction · 0.85
createWrapperFunction · 0.85
mergeFunction · 0.85
invokeFunction · 0.85
toArrayFunction · 0.85
firstFunction · 0.85
initialFunction · 0.85
lastFunction · 0.85
restFunction · 0.85
withoutFunction · 0.85
bindFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected