Skip to content

returns the size of an array or the number of properties of an object

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-MINI
Notifications You must be signed in to change notification settings

cosmosio/object-count

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Object count

Count the number of properties in an object, or return the number of items in an array. It doesn't look up in the prototype chain.

Installation

npm install object-count

How to use

Require object-count:

var count = require("object-count");

Use it with an object:

var anObject = {
  "property1": "with",
  "property2": "some",
  "property3": "data"
};

count(anObject); // 3

It also works with an array:

var anArray = ["with", "some", "data"];

count(anArray); // 3

LICENSE

MIT

About

returns the size of an array or the number of properties of an object

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE-MINI

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published