Arrays 010
const numbers = [0, 1, 2, 3, 4, 5];
const words = ['Pizza', 'Cheesy Cannelloni', 'Osso buco'];
-
Use the method
reduce()
to calculate the sum of all values contained in the arraynumbers
array. Assign the result to a new variablesum
. -
Use the method
reduce()
to find the longest word in the arraywords
. Assign the result to a new variablelongest
.
Join the waiting list to see the solution