Home » Web (page 4)

Web

Does it mutate?

This little site by Remy Sharp’s makes it clear whether or not a JavaScript method changes the original array (aka mutates) or not. I was actually bitten by this the other day. I needed the last element from an array, so I remembered .pop() and used it. const arr = ["doe", "ray", "mee"]; const last = arr.pop(); // mee, but ...

Read More »

Powered by WP Robot