MCPcopy Index your code
hub / github.com/nodejs/node / elementAt

Function elementAt

test/fixtures/snapshot/typescript.js:1298–1306  ·  view source on GitHub ↗

* Returns the element at a specific offset in an array if non-empty, `undefined` otherwise. * A negative offset indicates the element should be retrieved from the end of the array.

(array, offset)

Source from the content-addressed store, hash-verified

1296 * A negative offset indicates the element should be retrieved from the end of the array.
1297 */
1298 function elementAt(array, offset) {
1299 if (array) {
1300 offset = toOffset(array, offset);
1301 if (offset < array.length) {
1302 return array[offset];
1303 }
1304 }
1305 return undefined;
1306 }
1307 ts.elementAt = elementAt;
1308 /**
1309 * Returns the first element of an array if non-empty, `undefined` otherwise.

Callers

nothing calls this directly

Calls 1

toOffsetFunction · 0.85

Tested by

no test coverage detected