Or reduce?
-
-
-
Wait I'm blatantly wrong
- Još 3 druga odgovora
Novi razgovor -
-
-
ES10? I thought we were still on ES6

-
For anyone who might be curious:https://twitter.com/devcastcode/status/1196482943868448768 …
Kraj razgovora
Novi razgovor -
-
-
Only if you want to add more, though? This is neat!
-
Adding and removing! To remove an item, return an empty array in the callback.
Kraj razgovora
Novi razgovor -
-
-
Does a generic flattern exist though?
-
Yes, flat(), also ES10! Great overview from
@MozDevNet here:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat …
Kraj razgovora
Novi razgovor -
-
-
Is it still a map operation though?
-
It's essentially a more efficient way to do a map() followed by a depth 1 flat()! Flat also being an ES10 addition:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat …
Kraj razgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.