I’m a little confused by.flatMap() in JavaScript. like are people really running .map().flat() so often that they needed to combine them together to save people the trouble of typing three extra characters?
@kasdeya we would assume the rationale is that it can be implemented more efficiently by the browser?
@kasdeya something something, clever way to reduce allocations that will need to be garbage collected later
@kasdeya also just like, broadly speaking, the more steps that can be handled by the browser without going back into JS the better — both in stuff like data transformation and in animation / layout. this is why CSS animations are *basically always* more performant than doing requestAnimationFrame from JS
@tempest interesting omg. I didn’t realize that all of the built-in JavaScript methods and functions were handled by the browser directly - I kind of assumed that they were mostly JS code, kind of like how Python does it. but that makes sense considering that JS has been so aggressively optimized over time