VOOZH about

URL: https://www.geeksforgeeks.org/javascript/collect-js-skip-method/

⇱ Collect.js skip() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Collect.js skip() Method

Last Updated : 30 Nov, 2020

The skip() method is used to skip the given number of elements from collection and returns the remaining collection elements.

Syntax:

collect(array).skip(size)

Parameters: The collect() method takes one argument that is converted into the collection and then skip() method is applied on it. The skip() method holds the size (number of elements that you want to skip from collection) as parameter.

Return Value: This method returns the remaining collection elements.

Below example illustrate the skip() method in collect.js:

Example 1:

Output:

[ 'GeeksforGeeks', 'Welcome' ]

Example 2:

Output:

[ { name: 'Aditya', marks: 78 }, { name: 'Abhishek', marks: 87 } ]
Comment
Article Tags: