4 JavaScript Array methods you didn't know you needed
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
A quick reference to four underused JavaScript Array methods: `Array.at` for accessing items by negative index, `Array.flat` for flattening nested arrays, `Array.some`/`Array.every` for condition testing, and `Array.entries` for getting iteration indexes in `for..of` loops. Each method is shown with concise code examples and
Table of contents
Get the last item in an arrayFlatten an array of arraysTest an array's valuesGet the iteration index in a for..of loopSort: