LoginSignup
1
0

More than 5 years have passed since last update.

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

Last updated at Posted at 2017-08-10

問題

このevalはA,Bどちらと同じになるでしょう?

eval('{x:1}') //=> 1

・A

x:1           //=> ?

・B

{x:1}         //=> ?

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

答え

このevalはA,Bどちらと同じになるでしょう?

eval('{x:1}') //=> 1

・A

x:1           //=> 1

・B

{x:1}         //=> {x: 1}

答えはA。

1
0
9

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
0