Lodash _.prototype.toJSON() Method Last Updated : 18 Sep, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The _.prototype.toJSON() method of Sequence in lodash is used to execute the chain sequence in order to solve the unwrapped value. Syntax: _.prototype.toJSON() Parameters: This method doesn't accept any parameter. Return Value: This method returns the resolved unwrapped value. Below examples illustrate the Lodash _.prototype.toJSON() method in JavaScript: Example 1: JavaScript // Requiring lodash library const _ = require('lodash'); // Calling _.prototype.toJSON() method let unwrap_val = _([6, 7, 8]).toJSON(); // Displays output console.log(unwrap_val); Output: [ 6, 7, 8 ] Example 2: JavaScript // Requiring lodash library const _ = require('lodash'); // Defining values let values = {"gfg":3, "geek":15}; // Calling _.prototype.toJSON() method let res = _(values).toJSON(); // Displays output console.log(res); Output: { gfg: 3, geek: 15 } Comment More infoAdvertise with us N nidhi1352singh Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Lodash Similar Reads Lodash _.chain() Method Lodash _.chain() method is used to wrap the value with explicit method chain sequences enabled. Syntax:_.chain(value);Parameter:value parameter holds the value to wrap.Return value: This method returns the wrapped value. Example 1: In this example, we have used the _.chain() method in which we have 2 min read Lodash _.tap() Method Lodash _.tap() method of Sequence in lodash is used to call interceptor. Moreover, the main task of the method is to "tap into" a method chain sequence so that the intermediate results can be modified. Syntax:_.tap(value, interceptor);Parameters: value: It is the value to be given to the interceptor 2 min read Lodash _.thru() Method Lodash _.thru() method of Sequence in lodash is similar to _.tap() method and the only difference is that it returns the outcome of the interceptor. Moreover, this method is mainly used to âpass thruâ values in a method chain sequence by replacing intermediate results. Syntax:_.thru(value, intercept 2 min read Lodash _.prototype[Symbol.iterator]() Method Lodash _.prototype[Symbol.iterator]() method of Sequence in lodash is used to permit the wrapper to be iterable. Syntax:_.prototype[Symbol.iterator]();Parameters: This method doesn't accept any parameter. Return Value: This method returns the lodash wrapper object. Example 1: In this example, we are 1 min read Lodash _.prototype.at() Method Lodash _.prototype.at([paths]) method of Sequence in lodash is the wrapper version of the _.at() method which creates an array of values analogous to the specified paths of an object. Syntax:_.prototype.at([paths]);Parameters:[paths]: It is the paths property that is to be chosen.Return Value: This 1 min read Lodash _.prototype.chain() Method Lodash _.prototype.chain() method of Sequence in lodash is used to create an instance of lodash wrapper accompanied by explicit method chain sequences enabled. Syntax:_.prototype.chain();Parameters: This method doesn't accept any parameter. Return Value: This method returns the new lodash wrapper in 2 min read Lodash _.prototype.commit() Method Lodash _.prototype.commit() method is used to implement the chain sequence type and find the wrapped output. Syntax:_.prototype.commit();Parameters: This method does not accept any parameter. Return Value: This method returns the new lodash wrapper instance. Example 1: In this example, we are pushin 2 min read Lodash _.prototype.next() Method Lodash _.prototype.next() method of Sequence in lodash is used to find the next value on a wrapped object which follows the iterator protocol. Syntax:_.prototype.next();Return Value: This method returns the value of the next iterator. Example 1: In this example, it returns the next value of the wrap 2 min read Lodash _.prototype.plant() Method Lodash _.prototype.plant(value) method of Sequence in lodash is used to create a clone of the chain sequence type by planting the value to be planted as the wrapped value. Syntax:_.prototype.plant(value);Parameters: value: It is the value that needs to be planted.Return Value: This method returns th 1 min read Lodash _.prototype.reverse() Method Lodash _.prototype.reverse() method of Sequence in lodash is used to mutate the wrapped array. Moreover, it is the wrapper version of the _.reverse method of an array. Syntax:_.prototype.reverse();Parameters: This method doesn't accept any parameter. Return Value: This method returns the new lodash 1 min read Like