[Map|Set|WeakMap].prototype.isEmpty()?

2012-11-02 Thread Nicholas C. Zakas
I had mentioned this in passing in a previous email, but wanted to bring it up again. As I've been playing more with maps and sets, I've come to realize that I do this a lot: //note: FF implementation if (set.size() === 0) { ... } Basically, the only thing I've ever done with the

Re: [Map|Set|WeakMap].prototype.isEmpty()?

2012-11-02 Thread David Bruant
It does not apply to WeakMaps, but otherwise, I agree it's a nice method to have on Map and Set. David Le 02/11/2012 18:26, Nicholas C. Zakas a écrit : I had mentioned this in passing in a previous email, but wanted to bring it up again. As I've been playing more with maps and sets, I've

Re: [Map|Set|WeakMap].prototype.isEmpty()?

2012-11-02 Thread Andrea Giammarchi
we are used to `if (!arr.length) { }` so I don't see much different with collections and `size()` Said that, I have bad feelings when I read empty() thinking about all other set of inconsistencies famous in PHP world :-) On Fri, Nov 2, 2012 at 10:26 AM, Nicholas C. Zakas

Re: [Map|Set|WeakMap].prototype.isEmpty()?

2012-11-02 Thread Rick Waldron
On Fri, Nov 2, 2012 at 1:26 PM, Nicholas C. Zakas standa...@nczconsulting.com wrote: I had mentioned this in passing in a previous email, but wanted to bring it up again. As I've been playing more with maps and sets, I've come to realize that I do this a lot: //note: FF implementation