Saturday, October 11, 2025
HomeLanguagesJavascriptLodash _.add() Method

Lodash _.add() Method

The _.add() method is used to add two numbers.

Syntax:

_.add(augend, addend)

Parameters: This method accepts two parameters as mentioned above and described below:

  • augend: This parameter holds the first number in addition.
  • addend: This parameter holds the second number in addition.

Return Value: This method returns the result of adding two numbers.

Example 1: Here, const _ = require(‘lodash’) is used to import the lodash library into the file.

Javascript




// Requiring the lodash library  
const _ = require("lodash"); 
   
// Use of _.add() method 
let gfg = _.add(12, 38);
         
// Printing the output  
console.log(gfg)


Output:

50

Example 2:  

Javascript




// Requiring the lodash library  
const _ = require("lodash"); 
   
// Use of _.add() method 
let gfg = _.add(248, 723);
         
// Printing the output  
console.log(gfg)


 Output:

971
Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen 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!
RELATED ARTICLES

Most Popular

Dominic
32350 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6719 POSTS0 COMMENTS
Nicole Veronica
11880 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11941 POSTS0 COMMENTS
Shaida Kate Naidoo
6839 POSTS0 COMMENTS
Ted Musemwa
7101 POSTS0 COMMENTS
Thapelo Manthata
6794 POSTS0 COMMENTS
Umr Jansen
6794 POSTS0 COMMENTS