LoginSignup
0
0

More than 5 years have passed since last update.

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

Posted at

問題

function fn1(){
  console.log("[" + arguments.length + "]" + arguments[0]);
}
fn1(10); //=> [1]10

function fn2(){
  console.log("[" + arguments.length + "]" + arguments[0] + ", " + arguments[1]);
}
fn2(10); //=> ?

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

問題

function fn1(){
  console.log("[" + arguments.length + "]" + arguments[0]);
}
fn1(10); //=> [1]10

function fn2(){
  console.log("[" + arguments.length + "]" + arguments[0] + ", " + arguments[1]);
}
fn2(10); //=> [1]10, undefined
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