Collect.js pull() Method Last Updated : 30 Nov, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The pull() method is used to remove an element from collection by given key and return the pulled element. Syntax: collect(array).pull(key) Parameters: The collect() method takes one argument that is converted into the collection and then pull() method is applied on it. The pull() method holds the key as parameter. Return Value: This method returns the value of given key. Below example illustrate the pull() method in collect.js: Example 1: JavaScript const collect = require('collect.js'); let obj = ['Welcome', 'Geeks', 'GFG', 'GeeksforGeeks']; const collection = collect(obj); console.log(collection.pull(3)); Output: GeeksforGeeks Example 2: JavaScript const collect = require('collect.js'); let obj = { name: 'Rahul', dob: '25-10-96', section: 'A', score: 98, }; const collection = collect(obj); console.log(collection.pull('name')); console.log(collection.pull('dob')); Output: Rahul 25-10-96 Comment More infoAdvertise with us Next Article Collect.js pop() Method A ashokjaiswal Follow Improve Article Tags : JavaScript Web Technologies Collect.js Similar Reads Collect.js put() Method The put() method is used to set the given key and value in the collection. Syntax: collect(array).put(key) Parameters: The collect() method takes one argument that is converted into the collection and then put() method is applied on it. The put() method holds the key as parameter. Below example illu 1 min read Collect.js pluck() Method The pluck() method is used to return all the values from the given key. Syntax: collect(array).pluck(key) Parameters: The collect() method takes one argument that is converted into the collection and then pluck() method is applied on it. The pluck() method holds the key as parameter. Return Value: T 1 min read Collect.js split() Method The split() method in collect.js is used to break a collection into the given number of groups. Syntax: collect(array).split() Parameters: The collect() method takes one argument that is converted into the collection and then split() method is applied on it. Return Value: This method returns a colle 1 min read Collect.js sum() Method The sum() method in collect.js is used to return the sum of all the items in the given collection. Syntax: collect(array).sum() Parameters: The collect() method takes one argument that is converted into the collection and then sum() method is applied on it. Return Value: This method returns the sum 1 min read Collect.js pop() Method The pop() method is used to remove the last element from collection and returns the popped element. Syntax: collect(array).pop() Parameters: The collect() method takes one argument that is converted into the collection and then pop() method is applied on it. Return Value: This method returns the pop 1 min read Collect.js pad() Method The pad() method is used to fill the array with the given element until the size of the array is full. We use a negative size to pad the elements left side and use a positive sign to pad elements right side. If the array size is full then no padding will perform. Syntax: collect(array).pad(size, val 2 min read Like