Posts Tagged 'array'

2021-04-17 15:47 UTC

Misusing `map`

Posted 2021-04-17 15:47 UTC in javascript array map antipattern

Unfortunately, since late 2019 or early 2020 or so I'm increasingly seeing people (for instance, on Stack Overflow) misusing map like this: Note that: The map callback doesn't return anything The return value of map isn't used This is an antipattern…

2020-07-25 17:45 UTC

New: Relative Indexing Method for Indexables

Posted 2020-07-25 17:45 UTC in javascript new-toys indexable string array typed-array

The Stage 3 relative indexing method proposal adds an at method to strings, arrays, and typed arrays (collectively, "indexables"). Let's take a look! The Basics In its most basic form, the at method accepts an index and gives you the item at that…