What does the following code output? const a = [1, 2, 3]; const b = [1, 2, 3]; console.log(a == b, a === b); JavaScript DeveloperMedium Try Now
What does the following code output? class Animal { constructor(name) { this.name = name; } speak() { return `${this.name} makes a noise.`; } } class Dog extends Animal { speak() { return `${this.name} barks.`; } } const d = new Dog(‘Rex’); console.log(d.speak()); JavaScript DeveloperMedium Try Now
What is the output of the following? const {a: x, b: y = 10} = {a: 1}; console.log(x, y); JavaScript DeveloperMedium Try Now
Which of the following best describes how JavaScript handles the ‘this’ keyword inside a regular method called without explicit context? JavaScript DeveloperMedium Try Now
What does the following code output? const arr = [1, [2, [3]]]; console.log(arr.flat(1)); JavaScript DeveloperMedium Try Now
What is the difference between Object.entries() and Object.fromEntries()? JavaScript DeveloperMedium Try Now
What does Array.prototype.reduce() return when called on an empty array without an initial value? JavaScript DeveloperMedium Try Now
Which of the following correctly uses a getter in a JavaScript object literal? JavaScript DeveloperMedium Try Now
What does the following code produce? function* gen() { yield 1; yield 2; return 3; } const g = gen(); console.log([…g]); JavaScript DeveloperMedium Try Now