Saturday, November 15, 2025
HomeLanguagesJavascriptLodash _.prototype.value() Method

Lodash _.prototype.value() Method

Lodash is a JavaScript library that works on the top of underscore.js. Lodash helps in working with arrays, strings, objects, numbers, etc.

The _.prototype.value() method is used to execute the given chain sequence in order to resolve the unwrapped value. This method has the aliases _.prototype.toJSON and _.prototype.valueOf.

Syntax:

_.prototype.value()

Parameters: This method does not accept any parameter.

Return Value: This method returns the resolved unwrapped value.

Example 1:

Javascript




// Requiring lodash library
const _ = require('lodash');
  
// Using the _.prototype.value() method 
let result = _([5, 4, 7]).value();
  
// Display the result
console.log(result);


Output:

[ 5, 4, 7 ]

Example 2:

Javascript




// Requiring lodash library
const _ = require('lodash');
  
// Defining values
let values = { "f":3, "g":15 };
  
// Using the _.prototype.value() method 
let unwrap_val = _(values).value();
  
// Display the result
console.log(unwrap_val);


Output:

{ f: 3, g: 15 }
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
32399 POSTS0 COMMENTS
Milvus
95 POSTS0 COMMENTS
Nango Kala
6765 POSTS0 COMMENTS
Nicole Veronica
11917 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11984 POSTS0 COMMENTS
Shaida Kate Naidoo
6889 POSTS0 COMMENTS
Ted Musemwa
7143 POSTS0 COMMENTS
Thapelo Manthata
6838 POSTS0 COMMENTS
Umr Jansen
6840 POSTS0 COMMENTS