FIND YOUR NEXT FEW LINES

Results for “Array traversal & selection”

Small, practical examples. Search by task or narrow things down below.

228 snippets foundClear filters
JavaScriptArray traversal & selection

Check whether every item matches

JavaScript: every stops at the first failed predicate and returns true for an empty array.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Check whether every item matches

TypeScript: every stops at the first failed predicate and returns true for an empty array.

TypeScript✓ Tested
JavaScriptArray traversal & selection

Copy a range without changing the source

JavaScript: Array.slice returns a shallow copy of the selected half-open range.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Copy a range without changing the source

TypeScript: Array.slice returns a shallow copy of the selected half-open range.

TypeScript✓ Tested
JavaScriptArray traversal & selection

Find the position of a matching item

JavaScript: findIndex returns -1 when the predicate matches nothing.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Find the position of a matching item

TypeScript: findIndex returns -1 when the predicate matches nothing.

TypeScript✓ Tested
JavaScriptArray traversal & selection

Separate a first item from the remaining items

JavaScript: Array destructuring and a rest element produce named pieces of a sequence.

JavaScript✓ Tested
TypeScriptArray traversal & selection

Separate a first item from the remaining items

TypeScript: Array destructuring and a rest element produce named pieces of a sequence.

TypeScript✓ Tested
jQueryTraversal & selection

Collect matching ancestors

jQuery: parents can return several ancestors, ordered from the nearest outward.

jQuery✓ Tested
jQueryTraversal & selection

Return to the previous collection in a chain

jQuery: end restores the selection before the last traversal operation.

jQuery✓ Tested
jQueryTraversal & selection

Select a range from a collection

jQuery: slice includes the start index and excludes the end index.

jQuery✓ Tested
jQueryTraversal & selection

Select an element by zero-based position

jQuery: eq returns a jQuery collection containing the selected index.

jQuery✓ Tested