#arrays

[ follow ]
fromAllthingssmitty
8 months ago

Finally, safe array methods in JavaScript - Matt Smith

There's a good reason that many developers pause before using .sort(), .reverse(), or .splice() in JavaScript: those methods mutate the original array. That single side effect can lead to subtle, hard-to-trace bugs, especially in apps with shared or reactive state. The good news is that in the last couple of years we've gotten new array methods that make working with arrays safer and cleaner by avoiding mutation altogether: These return copies instead of changing the original array.
JavaScript
JavaScript
from2ality
9 months ago

Learning web development: Booleans, comparisons and `if` statements

Use booleans, comparisons, and if statements to execute code conditionally and understand primitives versus objects, including storage and identity differences.
[ Load more ]