-
Notifications
You must be signed in to change notification settings - Fork 0
findItem
SuperPhantomUser edited this page Jun 11, 2021
·
2 revisions
The findItem method returns an item using coordinates.
Array types: 2d+
Returns: any
Arguments:
- array
- coordinates (any)
Examples:
const array = [
["a", "b", "c", "d"],
["e", "f", "g", "h"]
];
console.log(Arrays.findItem(array, [1, 1]));
// Returns: "f"const array = [
["a", "b", "c", "d"],
["e", "f", "g", "h"]
];
console.log(Arrays.findItem(array, new Arrays.Coordinates(0, 3)));
// Returns: "d"const array = [
[
["a", "b", "c", "d"],
["e", "f", "g", "h"]
],
[
["i", "j", "k", "l"],
["m", "n", "o", "p"]
]
];
console.log(Arrays.findItem(array, { row: 0, column: 1, layer: 0 }));
// Returns: "e"