15. var x = `foo ${y}`,
y = `bar ${x}`;
console.log(y);
What’s the result of
this code?
1. bar foo bar
undefined
2. bar foo
undefined
3. bar foo
4. InternalError
16. What’s the result of
this code?
var x = `foo ${y}`,
y = `bar ${x}`;
console.log(y);
1. bar foo bar
undefined
2. bar foo
undefined
3. bar foo
4. InternalError
21. (new function f () {
this.a = 1;
return ((...b) => {
return this.a;
}).bind({ a: 9 });
})();
What’s the result of
this code?
1. 9
2. undefined
3. TypeError
4. 1
22. (new function f () {
this.a = 1;
return ((...b) => {
return this.a;
}).bind({ a: 9 });
})();
What’s the result of
this code?
1. 9
2. undefined
3. TypeError
4. 1
30. class MyClass {
const MY_CONST = 'string';
constructor() {
this.MY_CONST;
}
}
let myClass = new MyClass();
console.log(myClass.MY_CONST);
What’s the result of
this code?
1. ‘string’
2. SyntaxError
3. undefined
4. ReferenceError
31. class MyClass {
const MY_CONST = 'string';
constructor() {
this.MY_CONST;
}
}
let myClass = new MyClass();
console.log(myClass.MY_CONST);
What’s the result of
this code?
1. ‘string’
2. SyntaxError
3. undefined
4. ReferenceError
39. What’s the result of
this code?
1. f, f, f
2. f, t, f
3. f, t, t
4. t, t, t
class X {}
class Y extends X {}
console.log(Object.getPrototypeOf(X) ===
Function.prototype);
console.log(Object.getPrototypeOf(Y) === X);
console.log(Object.getPrototypeOf(new Y()) ===
Y.prototype)
40. What’s the result of
this code?
1. f, f, f
2. f, t, f
3. f, t, t
4. t, t, t
class X {}
class Y extends X {}
console.log(Object.getPrototypeOf(X) ===
Function.prototype);
console.log(Object.getPrototypeOf(Y) === X);
console.log(Object.getPrototypeOf(new Y()) ===
Y.prototype)
42. What’s the result of
this code?
1. []
2. [2,3,4,5,1]
3. [5,4,3,2,1]
4. Error
let f = (x, ...y) => x?[...f(...y), x]:[];
let arr = [], i = 0;
for (arr[i++] of f(1,2,3,4,5)) {}
console.log(arr);
43. What’s the result of
this code?
1. []
2. [2,3,4,5,1]
3. [5,4,3,2,1]
4. Error
let f = (x, ...y) => x?[...f(...y), x]:[];
let arr = [], i = 0;
for (arr[i++] of f(1,2,3,4,5)) {}
console.log(arr);