Skip to content

Commit 280db40

Browse files
committed
size() method implemented
1 parent 7d0a2fc commit 280db40

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,10 @@ const Q = new jsonQ(JsonObject).from('products').count();
316316

317317
See detail example [here](examples/count.js).
318318

319+
### `size()`
320+
321+
This is an alias method of `count()`.
322+
319323
### `max(property)`
320324

321325
* `property` -- the property name of the data

index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,15 @@ class JSJsonQ {
293293
return this._jsonContent.length;
294294
}
295295

296+
/**
297+
* size - returns the size of the collection
298+
*
299+
* @returns {int}
300+
*/
301+
size() {
302+
return this.count();
303+
}
304+
296305
/**
297306
* max - If a 'property' given as parameter this method will return the maximum
298307
* value of the collection contains that property, otherwise it will assume

0 commit comments

Comments
 (0)