Question from the Javascript test

Write a JavaScript function that returns the sum of all the elements in an array.

Easy

Consider the following JavaScript code:

const array = [1, 2, 3, 4, 5];
const reducedValue = array.reduce((a, b) => a + b, 0);

What will reducedValue contain after executing this code?

Author: AxelStatus: PublishedQuestion passed 60 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!