Question 26
What does the Array.prototype.map() method return in JavaScript?
map() creates a new array populated with the results of calling a provided function on every element in the calling array.
What does the Array.prototype.map() method return in JavaScript?
map() creates a new array populated with the results of calling a provided function on every element in the calling array.
Which ES6 feature uses three dots (...) to expand an iterable into individual elements or gather multiple arguments?
The spread syntax (...) allows an iterable such as an array or string to be expanded in places where zero or more arguments are expected.
Which method adds one or more elements to the end of an array in JavaScript and returns the new length?
push() adds one or more elements to the end of an array and returns the new array length.
Which method removes the FIRST element from an array in JavaScript?
shift() removes the first element from an array and returns that removed element.
Which built-in JavaScript object represents an asynchronous operation that will eventually complete or fail?
A Promise is an object representing the eventual completion or failure of an asynchronous operation.