Takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array-like.
The array-like to search.
The index of the item to return.
The item at the given index.
at(["a", "b"], 0) // "a"at(["a", "b"], 1) // "b"at(["a", "b"], 9) // undefinedat(["a", "b"], -1) // "b"at(["a", "b"], -2) // "a"at(["a", "b"], -9) // undefinedat("bar", 2) // "r"at("bar", -1) // "r"at(null, 0) // undefinedat(undefined, 1) // undefined Copy
at(["a", "b"], 0) // "a"at(["a", "b"], 1) // "b"at(["a", "b"], 9) // undefinedat(["a", "b"], -1) // "b"at(["a", "b"], -2) // "a"at(["a", "b"], -9) // undefinedat("bar", 2) // "r"at("bar", -1) // "r"at(null, 0) // undefinedat(undefined, 1) // undefined
Takes an integer value and returns the item at that index, allowing for positive and negative integers. Negative integers count back from the last item in the array-like.