3
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.

とりあえず本の紹介をしておきます。

dp_4048706705.jpeg

オブジェクト指向JavaScript

僕がActionScriptを触っていた頃は、オブジェクト指向といえばクラスベースオブジェクト指向のことだと思い込んでいたので、タイトルに衝撃でした。

さて、ここからはObjectオブジェクトの話をすればいいのですよね?

ということで、ここでは計6問のクイズを出題します。
みなさん、全問正解できるでしょうか!?

q-1.js
({}) !== ({}); // == ?
q-2.js
var a = {};
var b = {};
a[window] = 5;
b[window] = 5;
a[window] === b[window]; // == ?
q-3.js
var obj = {};
var obj = {};
obj[window] = 5;
obj.window = 3;
obj[window] !== obj.window; // == ?
q-4.js
var a = {};
var b = {};
a[{}] = 5;
b[{}] = 5;
a[{}] === b[{}] // == ?
q-5.js
!!(new Boolean(0)) // == ?
q-6.js
var obj1 = {a:5,b:3,c:8};
var obj2 = {b:3,a:5,c:8};

var keys1 = '';
var keys2 = '';

var i;
for(i in obj1) {
  keys1 += i;
}

for(i in obj2) {
  keys2 += i;
}

keys1 !== keys2 // == ?

答えはlevel0.kayac.comで。

3
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
3
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?