What does the following code output and why? function foo() { return { bar: ‘baz’ }; } function foo2() { return { bar: ‘baz’ }; } console.log(foo(), foo2()); JavaScript ProfessionalHard Try Now
Which internal slot does the specification use to track whether a Promise has been resolved, and what prevents resolving a Promise twice? JavaScript ProfessionalHard Try Now
What is the output of the following code? const obj = {}; obj[Symbol.toPrimitive] = (hint) => hint === ‘number’ ? 42 : ‘hello’; console.log(+obj, `${obj}`, obj + ”); JavaScript ProfessionalHard Try Now
What does the following implement? function pipe(…fns) { return x => fns.reduce((v, f) => f(v), x); } JavaScript DeveloperMedium Try Now
What is the output of: console.log(+’3′, +true, +null, +undefined)? JavaScript DeveloperMedium Try Now
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