VOOZH about

URL: https://www.geeksforgeeks.org/javascript/collect-js-count-function/

⇱ Collect.js count() Function - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Collect.js count() Function

Last Updated : 15 Oct, 2024

The count() function is used to count the number of collections in the element.

Syntax:

data.count()

Parameters:

This function does not accept any parameter

Return Value:

Returns the count of the element in that collection.

Example 1:Below examples illustrate the count() function in collect.js 

Output:

Total number of elements are: { total: 10 }

Example 2:

Output:

Total number of elements are : 4
Comment
Article Tags: