LoginSignup
1
1

More than 5 years have passed since last update.

[クイズ]javascriptと仲良くなるための一歩 第45話「this参照4」

Posted at

問題

var x = 1;
var obj3 = {
           x:3,
           doit3: function(){ console.log("method is called." + x); }
          }
obj3.doit3(); //=> ?

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

答え

var x = 1;
var obj3 = {
           x:3,
           doit3: function(){ console.log("method is called." + x); }
          }
obj3.doit3(); //=> method is called.1
1
1
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
1