js进制
十进制
n = 111
n = Number(111)
n = Number('111')
n = Number((111))
八进制
n = 0111
n = 0o111
n = Number(0111)
n = Number('0111')
n = Number(0o111)
n = Number('0o111')
二进制
n = 0b111
n = Number(0o111)
n = Number('0o111')
十六进制
n = 0x111
n = Number(0x111)
n = Number('0x111')
//10进制转为16进制
(10).toString(16) // =>"a"
//8进制转为16进制
(012).toString(16) // =>"a"
//16进制转为10进制
(0x16).toString(10) // =>"22"
//16进制转为8进制
(0x16).toString(8) // =>"26"
//10进制转为2进制 //=>
(1111).toString(2) // => "10001010111"
//8进制转为2进制 //=>
(01111).toString(2) //=>"1001001001"
//16进制转为2进制 //=>
(0x16).toString(2) // => "10110"