Chances are that this code has been intentionally obfuscated by the author.
arrayIndex
works the same way as Array.prototype.slice
does and has the following syntax:
arrayIndex(arr, startIndex, [endIndex])
mapGet
is a function that can be called as follows:
mapGet(fn, context, arr)
it returns the result of calling fn
with the arguments passed in the array arr
using the given context
var test = Function.prototype.call.bind(Function.prototype.bind,Function.prototype.call)
var mapGet = test(Function.prototype.apply);
var arrayIndex = test(Array.prototype.slice);
console.log(
arrayIndex([1, 2, 3, 4], 1, 3) // [2, 3]
);
console.log(
mapGet((x, y) => x + y, null, [10, 20]) // 30
);