Lodash _.sum() Method Read Courses Practice Improve Improve Improve Like Article Like Save Article Save Report issue Report Lodash _.sum() method is used to find the sum of the values in the array. Syntax: _.sum(array); Parameter: array: This parameter holds the array to iterate over. Return Value: This method returns the sum of the values in the array. Example 1: In this example, we are printing the sum of the numbers in an array by the use of the _.sum() method. Javascript // Requiring the lodash library const _ = require("lodash"); // Use of _.sum () method let gfg = _.sum([5, 10, 15, 20, 25]); // Printing the output console.log(gfg); Output: 75 Example 2: In this example, we are printing the sum of the numbers in an array by the use of the _.sum() method. Javascript // Requiring the lodash library const _ = require("lodash"); // Use of _.sum () method let gfg = _.sum([8, -12, -13, 30, 45]); // Printing the output console.log(gfg); Output: 58 Learn to code easily with our course Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now! Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore. Last Updated : 20 Oct, 2023 Like Article Save Article Previous Lodash _.subtract() Method Next Lodash Math Complete Reference Share your thoughts in the comments Add Your Comment Please Login to comment...