JavaScript Quiz – Test Your Coding Knowledge 0 votes, 0 avg The test begins as soon as you click the Start button. You may continue working until the time limit expires. When the time is up, your test will be submitted automatically, whether you have finished or not. Please manage your time carefully and review your answers before the deadline.When your time is up, your test will be submitted automatically, whether you have finished answering or not. Please manage your time wisely.JavaScript JavaScript Quiz – 20 Questions to Test Your SkillsTest your JavaScript knowledge with this 20-question quiz. Perfect for beginners and experienced developers to practice, learn, and sharpen their JS skills. 1 / 20What is logged?const target = { a: 1 }; const handler = { get: function(obj, prop) { return prop in obj ? obj[prop] : 42; } }; const p = new Proxy(target, handler); console.log(p.a, p.b); 1. 1 undefined 2. undefined 42 3. Throws an error 4. 1 42 2 / 20How does prototypal inheritance work in JavaScript? 1. Objects inherit properties and methods from a parent class blueprint defined with the class keyword. 2. Objects can inherit properties and methods directly from other objects through an internal [[Prototype]] link. 3. Inheritance is achieved by copying all properties and methods from a parent object to a child object at creation. 4. JavaScript does not support inheritance; it only supports object composition. 3 / 20What is the primary role of the Event Loop in JavaScript's runtime environment? 1. To compile JavaScript code into machine code for faster execution. 2. To handle all mathematical computations and offload them to the computer's GPU. 3. To manage the call stack, callback queue, and microtask queue, ensuring non-blocking asynchronous operations. 4. To prevent memory leaks by periodically garbage collecting unused variables. 4 / 20In JavaScript, what is the primary purpose of "truthy" and "falsy" value evaluation? 1. To enforce strict type checking in all conditional statements. 2. To allow non-Boolean values to be used in contexts that require a Boolean, enabling more flexible and concise code. 3. To automatically convert all values to strings for comparison. 4. It is a legacy feature with no practical purpose in modern JavaScript. 5 / 20What does this code most likely output?const formatter = new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }); console.log(formatter.format(123456.789)); 1. "€123,456.79" 2. "123.456,79 €" 3. "123 456,79 €" 4. "123.456,79€" 6 / 20Why would you use a WeakMap over a Map? 1. For better iteration performance. 2. To allow keys of any data type. 3. To prevent memory leaks by allowing keys to be garbage collected. 4. To have built-in sorting of keys. 7 / 20What is the result?const arrLike = { length: 3 }; const result = Array.from(arrLike, (v, i) => i * 2); console.log(result); 1. [0, 2, 4] 2. [undefined, undefined, undefined] 3. [null, null, null] 4. [] 8 / 20let and the Temporal Dead Zone (TDZ)console.log(example); let example = "value"; 1. undefined 2. "value" 3. Throws a ReferenceError 4. Throws a SyntaxError 9 / 20What does this code output? const result = ['1', '2', '3'].map(parseInt); console.log(result); 1. [1, 2, 3] 2. ['1', '2', '3'] 3. [1, NaN, NaN] 4. Throws an error 10 / 20In what order is the output logged? 1. 1, 2, 3, 4 2. 1, 4, 3, 2 3. 1, 4, 2, 3 4. 1, 4, 3, 2 11 / 20What is the output? function* generator() { yield 1; yield* [2, 3]; yield 4; } console.log([...generator()].join('-')); 1. "1-2-3-4" 2. "1-[2,3]-4" 3. "1-2,3-4" 4. Throws an error 12 / 20What is the purpose of the use strict directive? 1. Makes JavaScript run faster 2. Enables stricter parsing and error handling 3. Converts JavaScript to TypeScript 4. Allows using newer ES6 features 13 / 20What does console.log(2 + "2" - 1) output? 1. "21" 2. 21 3. "221" 4. 3 14 / 20Which symbol is used for strict equality comparison? 1. = 2. == 3. === 4. !== 15 / 20 What is the output of console.log([] == ![])? 1. true 2. false 3. undefined 4. Error 16 / 20Which method creates a new array with all elements that pass a test? 1. map() 2. filter() 3. reduce() 4. forEach() 17 / 20What will console.log(0.1 + 0.2 === 0.3) output? 1. true 2. false 3. undefined 4. Error 18 / 20What does "5" + 3 return in JavaScript? 1. 8 2. 53 3. "53" 4. Error 19 / 20Which method adds one or more elements to the end of an array? 1. push() 2. pop() 3. shift() 4. append() 20 / 20What will console.log(typeof null) output? 1. "object" 2. "null" 3. "undefined" 4. "string" Your score isThe average score is 15% 0% Restart quiz