The fastest way to convert a string to a number is using the + operator
eg. let num = +"5"
For further actions, you may consider blocking this person and/or reporting abuse
The fastest way to convert a string to a number is using the + operator
eg. let num = +"5"
For further actions, you may consider blocking this person and/or reporting abuse
mohiyaddeen7 -
Hana Sato -
Ritesh Shukla -
Mica -
Top comments (2)
This is literally the opposite of what's true:
perf comparison
Overall in real world applications, the performance difference is probably negligible unless you have to convert millions of numbers.
Less code does not equal "faster" or "better".
according to MDN