-
Notifications
You must be signed in to change notification settings - Fork 5
hasPath
Subhajit Sahu edited this page Feb 2, 2021
·
9 revisions
Checks if nested array has a path. 📦 😺 🏃 📼 🌔 📜 📰 📘
Alternatives: hasValue, hasPrefix, hasSuffix, hasInfix, hasSubsequence, hasPermutation, hasPath.
Similar: hasPath, getPath, setPath$, removePath$.
array.hasPath(x, p);
// x: a nested array
// p: pathconst array = require("extra-array");
var x = [[2, 4], 6, 8];
array.hasPath(x, [1]);
// true
array.hasPath(x, [0, 1]);
// true
array.hasPath(x, [0, 1, 2]);
// false