Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 252 Bytes

convert-string-to-number.mdx

File metadata and controls

14 lines (12 loc) · 252 Bytes
category created tags title
Tip
2021-02-22
JavaScript
Convert string to number

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

+'010'; // 10
+'2e1'; // 20
+'0xF'; // 15