1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[クイズ]javascriptと仲良くなるための一歩 第7話「数値への変換」

Last updated at Posted at 2017-07-23

参考:パーフェクトjavascript

第1問

Number('100x')
//=> ?
parseInt('100x')
//=> ?
Number('')
//=> ?
Number(true)
//=> ?
Number(false)
//=> ?
Number(null)
//=> ?
Number(undefined)
//=> ?

:mouse:
:cow:
:tiger:
:rabbit:
:dragon_face:
:snake:
:horse:
:sheep:
:monkey_face:
:bird:
:dog:
:boar:
:mouse:
:cow:
:tiger:
:rabbit:
:dragon_face:
:snake:
:horse:
:sheep:
:monkey_face:
:bird:
:dog:
:boar:

Number('100x')
//=> NaN
parseInt('100x')
//=> 100
Number('')
//=> 0
Number(true)
//=> 1
Number(false)
//=> 0
Number(null)
//=> 0
Number(undefined)
//=> NaN
1
3
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
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?