← #1 Get characters of a string
#2

Convert string to number

Topics: JavaScript

Instead of using the Number() constructor to convert a string to number, you can use the + operator:

+'010';     // 10
+'2e1'; // 20
+'0xF'; // 15
Fix a typo or suggest an improvement
#3 Merge different arrays