What is the output of the following? “`js const s = new Set([1, 2, 2, 3, 3, 3]); console.log([…s]); console.log(s.size); “` JavaScript DeveloperHard Try Now
What is the output of the following? “`js const arr = [1, [2, [3, [4]]]]; console.log(arr.flat(Infinity)); “` JavaScript DeveloperHard Try Now
What is the Revealing Module Pattern and what problem does it solve? JavaScript DeveloperHard Try Now
What is `Intl.NumberFormat` used for and what does `new Intl.NumberFormat(‘en-US’, {style:’currency’, currency:’USD’}).format(1234.56)` produce? JavaScript DeveloperHard Try Now
What is the output of the following? “`js const p = Promise.reject(42); p.catch(v => v + 1).then(console.log); “` JavaScript DeveloperHard Try Now
What is the output of the following? “`js class Base { static greet() { return ‘Hello from Base’; } } class Child extends Base {} console.log(Child.greet()); console.log(Object.getPrototypeOf(Child) === Base); “` JavaScript DeveloperHard Try Now
What is the difference between `import()` dynamic import and static `import` in ES modules? JavaScript DeveloperHard Try Now
What is the output of the following? “`js let x = 10; const fn = () => { let x = 20; return () => x; }; console.log(fn()()); “` JavaScript DeveloperHard Try Now
What is the output of the following? “`js const [a, b, …rest] = [1, 2, 3, 4, 5]; console.log(rest); console.log(typeof rest); “` JavaScript DeveloperHard Try Now
What is the difference between `Error.captureStackTrace()` and a regular `new Error()` in terms of stack trace manipulation? JavaScript DeveloperHard Try Now
What is currying in JavaScript and how does it differ from partial application? JavaScript DeveloperHard Try Now
What is the output of the following? “`js const a = { val: 1 }; const b = { val: 2 }; const weakSet = new WeakSet([a, b]); console.log(weakSet.has(a)); console.log(weakSet.size); “` JavaScript DeveloperHard Try Now
What is the output of the following? “`js const obj = {}; Object.defineProperty(obj, ‘x’, { get() { return 42; }, set(v) { console.log(‘set:’, v); } }); obj.x = 10; console.log(obj.x); “` JavaScript DeveloperHard Try Now
What is event delegation in JavaScript and why is it preferred over attaching listeners to each element? JavaScript DeveloperHard Try Now
What is the output of the following? “`js function* fibonacci() { let [a, b] = [0, 1]; while (true) { yield a; [a, b] = [b, a + b]; } } const fib = fibonacci(); const result = Array.from({length: 5}, () => fib.next().value); console.log(result); “` JavaScript DeveloperHard Try Now