Lodash _.prototype.chain() Method Last Updated : 03 Nov, 2023 Comments Improve Suggest changes Like Article Like Report 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 instance. Example 1: In this example, we are chaining the given array and getting the tail value by the use of the lodash _.prototype.chain() method. JavaScript // Requiring lodash library const _ = require('lodash'); // Initializing authors variable let authors = [ { 'author': 'Nidhi', 'articles': 750 }, { 'author': 'Nisha', 'articles': 500 } ]; // Calling chain() method and creating // an explicit chaining sequence let result = _(authors).chain() .tail() .value(); // Displays output console.log(result); Output: [ { author: 'Nisha', articles: 500 } ]Example 2: In this example, we are chaining the given array and getting the head value having article as a key by the use of the lodash _.prototype.chain() method. JavaScript // Requiring lodash library const _ = require('lodash'); // Initializing authors variable let authors = [ { 'author': 'Nidhi', 'articles': 750 }, { 'author': 'Nisha', 'articles': 500 } ]; // Calling chain() method and creating // an explicit chaining sequence let result = _(authors).chain() .head() .pick('articles') .value(); // Displays output console.log(result); Output: { articles: 750 }Example 3: In this example, we are chaining the given string by the use of the lodash _.prototype.chain() method. JavaScript // Requiring lodash library const _ = require('lodash'); // Calling chain() method and creating // an explicit chaining sequence let obj = _("GeeksforGeeks").chain().value(); // Displays output console.log(obj[0]); console.log(obj[4]); console.log(obj[7]); console.log(obj[11]); Output: G s r kReference: https://lodash.com/docs/4.17.15#prototype-chain Comment More infoAdvertise with us Next Article Lodash _.prototype.commit() Method 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