Loading…
A short voice session: one question, one follow-up, then instant feedback — up to 5 minutes.
Rest collects remaining values; spread expands values into another expression, such as function arguments or array elements.
In function sum(...numbers), numbers is an array containing the supplied arguments. Math.max(...[2, 5, 1]) expands that array into three arguments. const copy = [...items] creates a shallow array copy, so nested objects remain shared. Object spread such as {...obj} copies own enumerable properties into a new object; it also does not deeply clone nested values.