UNPKG

@stdlib/array

Version:
37 lines (26 loc) 709 B
{{alias}}( x, i0, i1 ) Returns an element from a two-dimensional nested array. Negative indices are resolved relative to the last element along the respective dimension, with the last element corresponding to `-1`. If provided out-of-bounds indices, the function always returns `undefined`. Parameters ---------- x: ArrayLikeObject Input nested array. i0: integer First dimension index. i1: integer Second dimension index. Returns ------- out: any Element value. Examples -------- > var x = [ [ 1, 2 ], [ 3, 4 ] ]; > {{alias}}( x, 0, 1 ) 2 > {{alias}}( x, 1, 0 ) 3 See Also --------