how to use the values function from lodash in javascript

The _.values(obj) function from Lodash library in JavaScript takes an object as an argument and returns an array of its values. Here is an example usage:

index.tsx
const _ = require('lodash');

const user = {
  firstName: 'John',
  lastName: 'Doe',
  age: 30
};

const values = _.values(user);
console.log(values); // Output: [ 'John', 'Doe', 30 ]
184 chars
11 lines

In this example, the _.values function takes the user object and returns an array with the values of keys firstName, lastName, and age. The resulting values array is then logged to the console.

gistlibby LogSnag