Even wat lichtere materie en kijken of dit aanslaat...
Als je bezig bent met Javascript (op welk niveau dan ook) dan zijn de volgende 2 testen leuk om te doen
Ik heb ze van twee verschillende websites afgehaald, omdat (op iig 1) alle antwoorden gewoon uitgelegd zijn en we hier wellicht nog een beetje kunnen napraten
Probeer ze niet te runnen, maar gewoon zelf te bedenken wat de antwoorden zijn en stel hier ook je vragen (mocht je er niet uitkomen). Vragen kan je gewoon stellen, maar misschien wel zo liev (voor je mede-users) om spoilers in de spoiler-tag te plaatsen.
Even wat leidraad:

• Questions are multiple choice with only one possible answer
• ECMAScript 3rd edition (not 5th)
• Implementation quirks do not count (assuming standard behavior only)
• Every snippet is run as a global code (not as eval or function one)
• There are no other variables declared (and host environment is not extended with anything beyond what’s defined in specs)
• Answer should correspond to exact return value of entire expression/statement (or last line)
• “Error” in answer indicates that overall snippet results in a runtime error
a. "object"
b. "array"
c. "arguments"
d. "undefined"
a. "Number"
b. "undefined"
c. "function"
d. Error
a. 1
b. null
c. undefined
d. Error
a. 1
b. "number"
c. undefined
d. "undefined"
a. "number"
b. "undefined"
c. "function"
d. Error
a. "undefined"
b. "object"
c. "number"
d. "function"
a. "undefined"
b. "object"
c. "number"
d. "function"
a. "string"
b. "number"
c. "function"
d. "undefined"
a. 1
b. "1function"
c. "1undefined"
d. NaN
a. "number"
b. "string"
c. "undefined"
d. "object"
a. "undefined"
b. "object"
c. "number"
d. Error
a. 1
b. 2
c. Error (bijv. "Too much recursion")
d. undefined
a. true
b. false
a. 1
b. 2
c. undefined
d. Error
Als je bezig bent met Javascript (op welk niveau dan ook) dan zijn de volgende 2 testen leuk om te doen
Ik heb ze van twee verschillende websites afgehaald, omdat (op iig 1) alle antwoorden gewoon uitgelegd zijn en we hier wellicht nog een beetje kunnen napraten
Probeer ze niet te runnen, maar gewoon zelf te bedenken wat de antwoorden zijn en stel hier ook je vragen (mocht je er niet uitkomen). Vragen kan je gewoon stellen, maar misschien wel zo liev (voor je mede-users) om spoilers in de spoiler-tag te plaatsen.
Even wat leidraad:
Vraag 1 - 5
[list]• Geef aan wat het resultaat is van het scriptVraag 6 -19
[list]• Questions are multiple choice with only one possible answer
• ECMAScript 3rd edition (not 5th)
• Implementation quirks do not count (assuming standard behavior only)
• Every snippet is run as a global code (not as eval or function one)
• There are no other variables declared (and host environment is not extended with anything beyond what’s defined in specs)
• Answer should correspond to exact return value of entire expression/statement (or last line)
• “Error” in answer indicates that overall snippet results in a runtime error
1
JavaScript:
1
2
3
4
| if (!("a" in window)) { var a = 1; } alert(a); |
2
JavaScript:
1
2
3
4
5
| var a = 1, b = function a(x) { x && a(--x); }; alert(a); |
3
JavaScript:
1
2
3
4
5
| function a(x) { return x * 2; } var a; alert(a); |
4
JavaScript:
1
2
3
4
5
| function b(x, y, a) { arguments[2] = 10; alert(a); } b(1, 2, 3); |
5
JavaScript:
1
2
3
4
| function a() { alert(this); } a.call(null); |
6
JavaScript:
1
2
3
| (function(){ return typeof arguments; })(); |
a. "object"
b. "array"
c. "arguments"
d. "undefined"
7
JavaScript:
1
2
| var f = function g(){ return 23; }; typeof g(); |
a. "Number"
b. "undefined"
c. "function"
d. Error
8
JavaScript:
1
2
3
4
| (function(x){ delete x; return x; })(1); |
a. 1
b. null
c. undefined
d. Error
9
JavaScript:
1
2
| var y = 1, x = y = typeof x; x; |
a. 1
b. "number"
c. undefined
d. "undefined"
10
JavaScript:
1
2
3
| (function f(f){ return typeof f(); })(function(){ return 1; }); |
a. "number"
b. "undefined"
c. "function"
d. Error
11
JavaScript:
1
2
3
4
5
6
7
| var foo = { bar: function() { return this.baz; }, baz: 1 }; (function(){ return typeof arguments[0](); })(foo.bar); |
a. "undefined"
b. "object"
c. "number"
d. "function"
12
JavaScript:
1
2
3
4
5
| var foo = { bar: function(){ return this.baz; }, baz: 1 } typeof (f = foo.bar)(); |
a. "undefined"
b. "object"
c. "number"
d. "function"
13
JavaScript:
1
2
| var f = (function f(){ return "1"; }, function g(){ return 2; })(); typeof f; |
a. "string"
b. "number"
c. "function"
d. "undefined"
14
JavaScript:
1
2
3
4
5
| var x = 1; if (function f(){}) { x += typeof f; } x; |
a. 1
b. "1function"
c. "1undefined"
d. NaN
15
JavaScript:
1
2
| var x = [typeof x, typeof y][1]; typeof typeof x; |
a. "number"
b. "string"
c. "undefined"
d. "object"
16
JavaScript:
1
2
3
| (function(foo){ return typeof foo.bar; })({ foo: { bar: 1 } }); |
a. "undefined"
b. "object"
c. "number"
d. Error
17
JavaScript:
1
2
3
4
5
| (function f(){ function f(){ return 1; } return f(); function f(){ return 2; } })(); |
a. 1
b. 2
c. Error (bijv. "Too much recursion")
d. undefined
18
JavaScript:
1
2
| function f(){ return f; } new f() instanceof f; |
a. true
b. false
19
JavaScript:
1
| with (function(x, undefined){}) length; |
a. 1
b. 2
c. undefined
d. Error
Ace of Base vs Charli XCX - All That She Boom Claps (RMT) | Clean Bandit vs Galantis - I'd Rather Be You (RMT)
You've moved up on my notch-list. You have 1 notch
I have a black belt in Kung Flu.