Blog for web developers

Reduce single line code to find max, min and sum from array

Reduce is a function that reduce any array into a single value. It simply accept two parameters. In this article I will show you how to perform with reduce to execute a single value from an array.

reduce(callback, 0)

  • Callback function
  • Accumulator starting point (optional)

If no second parameter is defined it will take array first element as starting point of accumulator starting.

Santosh Shah

I am a JavaScript developer having enthusiasm on most frontend skills like JavaScript, HTML, CSS, SASS, node, gulp, angular etc. I love exploring new techniques and like to learn new technologies to keep my self up to date.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.