“It’s only work if somebody makes you do it.” • craft code • creative ideas • cutting edge • author • senior front end architect • professional scuba diver • adventures above and below the sea level
Location
Germany
Work
Senior Front End Architect, Full Stack Engineer, Creative Technologist and Scuba Diving Professional
Thank you for sharing! Yes, there are multiple other ways to achieve this task in javascript. As so often in programming, at one point you have to choose ;)
I checked the benchmarks and for me the alternative you provided is much slower (11,688 ops/sec vs. 7.81 ops/sec on jsbench). But of course there can be different performance results depending on the engine and environment as well as other factors for the decision which way to go.
Cheers!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thank you for sharing! Yes, there are multiple other ways to achieve this task in javascript. As so often in programming, at one point you have to choose ;)
I checked the benchmarks and for me the alternative you provided is much slower (
11,688 ops/sec
vs.7.81 ops/sec
on jsbench). But of course there can be different performance results depending on the engine and environment as well as other factors for the decision which way to go.Cheers!