An array of ways ... to create arrays (JS Basics)
HTML-код
- Опубликовано: 3 июл 2024
- Even in 2024, creating arrays in JavaScript has a few gotchas that you'll want to know about! And don't let sparse arrays catch you off guard!
My Links
shaky.sh
shaky.sh/tools
#programming #coding #typescript #javascript #frontenddeveloper #backenddeveloper #softwareengineer #softwareengineering #softwaredevelopment #javascriptbasics - Наука
The real benefit of 'Array.from({ length: 5 }, (i) => { ... })' is that it doesn't allocate an intermediate array to map on. This could lead to significant performance improvement, especially on large arrays.
Ooh, good to know!
Supercool!
We lately had exactly that bug where a coworker removed that "unnecessary" spread of Array(x)
Hi man, this video made my tests green, thank you a lot 🙏
Really enjoyed watching, would love more javascript basics videos like this one
always a good day when a notification for a new Andrew Burgess comes in!
As much as I like js I feel like sparse arrays were created as a gotcha for developers young and old.
Loved it, as usual!!!
JS is insane 😜
really interesting info, thanks
do you mind going over you ide, how you have it set up and how do you navigate around it with mostly jyour keyboard
[1, 2, 3, 4, 5] that's how i create an array
They should have just gone with a consistent approach where the sparse "empty" cells have an undefined value rather than them being literally empty which affects the stream operators of the array... typical JS 🤦♂️