0
0

More than 1 year has passed since last update.

javascript12_数値の進数について

Last updated at Posted at 2022-02-18

jsの中に、16進数を表したい時に、0xから始まる必要があります。

8進数は0から始めます。

2進数は0bから始めます。適用できないブラウザがあります。

image.png

上記の例を解決する方法としては、parseInt()のなかに、二番目の引数で進数を指定することができます。
image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0