Skip to content

AABoyles/betterarrays

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published