VOOZH about

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

⇱ Collect.js isEmpty() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Collect.js isEmpty() Method

Last Updated : 27 Nov, 2020

The isEmpty() method is used to check the given collection is empty or not and returns the corresponding boolean value.

Syntax:

collect(array).isEmpty()

Parameters: The collect() method takes one argument that is converted into the collection and then isEmpty() method is applied on it.

Return Value: This method checks the given collection is empty or not and returns the corresponding boolean value.

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

Example 1:

Output:

true

Example 2:

Output:

true
false
Comment
Article Tags: