Wednesday 3 February 2016

Diving Into Lodash: Slice Method

Diving Into Lodash: Slice Method: "function slice(array, start, end) {
start || (start = 0);
if (typeof end == 'undefined') {
end = array ? array.length : 0;
}
var index = -1,
length = end - start || 0,
result = Array(length < 0 ? 0 : length);

while (++index < length) {
result[index] = array[start + index];
}
return result;
}"



'via Blog this'

No comments: