UNPKG

@extra-array/get-path

Version:

Gets value at path in a nested array.

10 lines (9 loc) 179 B
function is(v) { return Array.isArray(v); } function getPath(x, p) { for (var i of p) x = is(x) ? x[i] : undefined; return x; } export { getPath as default };