It's less performant, but not dramatic. Whether or not this is faster is an implementation detail in the runtime essentially. It is a lot more concise though, and hard to get wrong. 99/100 times i'd just import uniq / uniqBy from lodash anyway.
It's the construction and iteration of an entirely unnecessary unordered container
It's not clear how you'd make this "dramatically worse" that this isn't, other than to just make it wrong, or do something nonsensical
Yes, it's dramatic. It's large constant big o lg n twice plus small constant big o n lg n for literally no reason.
.
Whether or not this is faster is an implementation detail in the runtime essentially
this isn't even close to correct
.
It is a lot more concise
Not than the good answer
.
99/100 times i'd just import uniq / uniqBy from lodash anyway.
Wow, please don't give advice anymore
I've had to update my libraries 11 times this week because people like you imported lodash or underscore for no good reason, and they're full of bugs and security problems
It's so hard to just have decent testing or doc generation because of things like this :(
This is the mindset that left a serious chunk of the internet broken over padLeft
This is the mindset that left a serious chunk of the internet broken over padLeft
This is also completely incorrect. People using packages was not the root cause of that problem. npm allowing packages to be removed at will was certainly a problem. people counting on npm to be always up was certainly a problem. javascript having a pathetic standard library was mainly to blame.
You weren't even right about a single thing in that massive wall of text which is pretty impressive.
78
u/StoneCypher May 14 '21
no, dramatically worse.
this is actually a terrible approach, and a big part of the reason why you shouldn't learn javascript from memes by dev.to spammers on reddit