11.) What is destructuring in ES6?
A) Breaking arrays or objects into smaller parts
B) Modifying array elements
C) Concatenating arrays
D) Copying objects
12.) How does Object.entries() work in ES6?
A) Converts an object into a string
B) Returns an array of key-value pairs from an object
C) Merges two objects
D) Creates an object clone
13.) What is the difference between == and === in ES6?
A) No difference
B) == checks type and value; === checks only value
C) == checks only value; === checks type and value
D) Both perform type coercion
14.) What does the filter() method do?
A) Removes duplicates from an array
B) Filters elements based on a condition
C) Transforms array elements
D) Mutates the original array
15.) What is the purpose of reduce() in JavaScript?
A) optioReduces array size1
B) Executes a reducer function on each element, resulting in a single output
C) Concatenates arrays
D) Filters elements
16.) What does Object.assign() do?
A) Copies values from one object to another
B) Creates an object reference
C) Merges two arrays
D) Declares an object
17.) Which new feature was introduced in ES6 for iteration?
A) forEach
B) for…of
C) while
D) do…while
18.) Which feature allows you to create computed property names in objects?
A) Template literals
B) Arrow functions
C) Square brackets ([])
D) Object.assign()
19.) What does the rest parameter (…) do?
A) Expands arrays into individual elements
B) Condenses multiple arguments into an array
C) Creates an object
D) Declares optional arguments
20.) What does the includes() method do in ES6?
A) Checks if an array contains a specified value
B) Checks if a string contains a substring
C) Works on both arrays and strings
D) All of the above
Related