+ 3

Number() method

Why does Number("0x11") return 17? Mind blown. Thanks.

1st Dec 2018, 4:58 AM
DumbledoresAmy
DumbledoresAmy - avatar
2 Answers
+ 13
Its hexadecimal i.e base 16 Convert hex 0x11 to decimal 1×16^1+1×16^0 17
1st Dec 2018, 5:09 AM
Rstar
Rstar - avatar
+ 4
Rstar Thank you so much 😎 I never would have guessed this!
1st Dec 2018, 5:18 AM
DumbledoresAmy
DumbledoresAmy - avatar