The reduce() function of array object apply a function simultaneously against two values of the array (from left-to-right) as to reduce it to a single value. Use it for example to perform operation on each element of an array.
Syntax
This will produce following result
This will produce following result