LoginSignup
0
2

More than 5 years have passed since last update.

[クイズ]javascriptと仲良くなるための一歩 第38話「配列」

Posted at

問題

第1問

var arr = [0,,2]
arr[1] //=> ?

第2問

var arr = [0]
arr[2] = 2
arr[1]     //=> ?
arr.length //=> ?

: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:

答え

第1問

var arr = [0,,2]
arr[1] //=> undefined

第2問

var arr = [0]
arr[2] = 2
arr[1]     //=> undefined
arr.length //=> 3
0
2
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
2