JavaScript 50 Quiz Questions

1. What is the output of the following code? console.log(typeof null); A) “object”B) “null”C) “undefined”D) “boolean” Answer: A) “object” 2. How can you create an immutable object in JavaScript? A) Object.freeze(obj)B) Object.seal(obj)C) Object.preventExtensions(obj)D) Object.immutable(obj) Answer: A) Object.freeze(obj) 3. What does the reduce method do? A) Iterates over an array and returns a new arrayB) Iterates ...