Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I used the spread operator for the first time while learning react but what is it based on?
-
@Root Not in terms of efficiency, but it's elegant, innovative and can be useful in many cases
-
Voxera115854y@theabbie it does not necessarily have to have any performance penalty as its most likely just rewritten into a more standard form under the hood.
And many times it will be easy for the compiler to find the best way :) -
@Voxera Some Stackoverflow Answers suggest it is slower, but that's unnoticeable unless there are millions of items
-
Voxera115854y@theabbie as I said “not necessarily “
Sure for lots of data or some cases hand coding can use your prior knowledge to optimize things as in so many cases.
But most of us either do not know enough to do a better job or know enough to know its not worth spending the time for it.
There are almost always something else where you can get better performance gains :P
And frankly, few of us really build software where that kind of performance tweeking is motivated anyway :)
Some do sure, but you already know who you are and probably why you would not use spread, if it even exist in the language you use :P -
I thought it was supposed to be "biased".
But what does "based" mean in this context? I googled it but I only found meaning for something being based on something else. But that doesn't apply here apparently. -
@K-Hole For fucksake, I'm gen z and I still don't know what based, woke and mood mean.
Spread operator is so fucking based!!!
rant