-
Notifications
You must be signed in to change notification settings - Fork 0
allLocalIndexesOf
SuperPhantomUser edited this page Jun 10, 2021
·
2 revisions
The allLocalIndexesOf method returns an array with all the local indexes of an item found
Note: a local index of an item is the index of that item in the deepest array it's in
Array types: 2d+
Returns: array
Arguments:
- array
- item
Examples:
const array = [
["a", "b", "c", "b"],
["e", "f", "b", "h"]
];
console.log(Arrays.allLocalIndexesOf(array, "b"));
// Returns: [1, 3, 2]const array = [
[
["a", "b", "c", "a"],
["e", "f", "g", "h"]
],
[
["i", "a", "k", "l"],
["m", "a", "o", "p"]
]
];
console.log(Arrays.allLocalIndexesOf(array, "a"));
// Returns: [0, 3, 1, 1]