add after ary assign assignIn assignInWith assignWith at before bind bindAll bindKey camelCase capitalize castArray ceil chain chunk clamp clone cloneDeep cloneDeepWith cloneWith compact concat conformsTo countBy create curry curryRight debounce deburr defaults defaultsDeep defer delay difference divide drop dropRight each eachRight endsWith entries entriesIn eq escape every extend extendWith fill filter find findIndex findKey findLast findLastIndex findLastKey first flatMap flatMapDeep flatMapDepth flatten flattenDeep flattenDepth flip floor forEach forEachRight forIn forInRight forOwn forOwnRight fromPairs functions functionsIn get groupBy gt gte has hasIn head inRange includes indexOf initial intersection invert invertBy invoke invokeMap isArguments isArray isArrayBuffer isArrayLike isArrayLikeObject isBoolean isBuffer isDate isElement isEmpty isEqual isEqualWith isError isFinite isFunction isInteger isLength isMap isMatch isMatchWith isNaN isNative isNil isNull isNumber isObject isObjectLike isPlainObject isRegExp isSafeInteger isSet isString isSymbol isTypedArray isUndefined isWeakMap isWeakSet join kebabCase keyBy keys keysIn last lastIndexOf lowerCase lowerFirst lt lte map mapKeys mapValues max maxBy mean meanBy memoize merge mergeWith min minBy multiply negate nth omit omitBy once orderBy overArgs pad padEnd padStart parseInt partial partialRight partition pick pickBy pull pullAll pullAllBy pullAllWith pullAt random rearg reduce reduceRight reject remove repeat replace rest result reverse round sample sampleSize set setWith shuffle size slice snakeCase some sortBy sortedIndex sortedIndexOf sortedLastIndex sortedLastIndexOf sortedUniq split spread startCase startsWith subtract sum sumBy tail take takeRight tap template throttle thru toArray toFinite toInteger toLength toLower toNumber toPairs toPairsIn toPlainObject toSafeInteger toString toUpper transform trim trimEnd trimStart truncate unary unescape union uniq uniqBy uniqWith unset unzip unzipWith update updateWith upperCase upperFirst values valuesIn without words wrap wrapperAt wrapperChain wrapperCommit wrapperFlatMap wrapperLodash wrapperNext wrapperPlant wrapperReverse wrapperToIterator wrapperValue xor zip zipObject zipObjectDeep zipWith

Lodash _.valuesIn

Overview

The lodash _.valuesIn method is a useful function in JavaScript that is a part of the popular utility library Lodash. This method is designed to extract all enumerable properties of an object, including inherited ones, and return them as an array of values in the order they appear.

To put it simply, the _.valuesIn method allows developers to access all the values of an object in a simple and efficient way. This can be especially helpful when you are dealing with complex nested objects that have many levels of properties and values.

The syntax for the _.valuesIn method is very simple. You simply call the method on the object you want to extract the values from, like this:

_.valuesIn(object)

The 'object' argument is the object you want to extract the values from. The method returns an array of all the values of the object, including inherited properties.

One important thing to note is that the _.valuesIn method returns not only the values of the enumerable properties, but also the values of non-enumerable properties. This means that any property with the 'enumerable' flag set to 'false' will still be included in the returned array.

Here is an example of how the _.valuesIn method can be used:

const person = {
  firstName: 'John',
  lastName: 'Doe',
  get fullName() {
    return `${this.firstName} ${this.lastName}`;
  }
};

const values = _.valuesIn(person);

console.log(values);
// Output: ['John', 'Doe', function fullName() { return `${this.firstName} ${this.lastName}`; }]

In this example, we create a person object with three properties: firstName, lastName, and fullName; but fullName is a getter function. The _.valuesIn method is then called on the person object which returns an array containing all the values of the properties of the object, including the fullName function.

Overall, the lodash _.valuesIn method is a powerful tool that simplifies working with objects in JavaScript. By using this method, developers can easily access all the values of an object, including inherited properties and non-enumerable properties.