The _.valuesIn() method is used to return the array of the own and inherited enumerable string keyed property values of object.
Syntax:
_.valuesIn(object)
Parameters: This method accepts a single parameter as mentioned above and described below:
- object: This parameter holds the object to query.
Return Value: This method returns the array of property values of the object element.
Example 1:
Javascript
// Requiring the lodash library const _ = require( "lodash" ); // The source object var obj = { Name: "neveropen" , password: "gfg@1234" , username: "your_neveropen" } // Use of _.valuesIn() method console.log(_.valuesIn(obj)); |
Output:
["neveropen", "gfg@1234", "your_neveropen"]
Example 2:
Javascript
// Requiring the lodash library const _ = require( "lodash" ); // The source function function Fb() { this .id = 2045; this .username = 'fb_myself' ; this .password = 'fb1234' ; } Fb.prototype.email = 'myself@gmail.com' ; // Use of _.valuesIn() method console.log(_.valuesIn( new Fb)); |
Output:
[2045, "fb_myself", "fb1234", "myself@gmail.com"]