betterarrays
v1.1.0
Published
*Make your arrays better.*
Downloads
8
Readme
betterarrays
Make your arrays better.
How?
In Node:
require('betterarrays');
In Browser:
<script src="betterarrays.js"></script>
What?
const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
const vowels = 'aeiou'.split('');
alphabet.without(vowels);
//> ["b", "c", "d", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "v", "w", "x", "y", "z"]
Why?
Chaining!
const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');
const vowels = 'aeiou'.split('');
alphabet
.without(vowels)
.first();
//> "b"
Why not?
Enumerable Properties!
for(a in ['a']){
console.log(a);
}
// What we should expect:
//> 'a'
// What we get:
//> 'a'
//> <a bunch of functions>