Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

example file

  • Loading branch information...
commit d26b97e8e22cda5cbdc9febd46cdd1b2e50eecd1 1 parent 6b1a677
@substack authored
Showing with 14 additions and 0 deletions.
  1. +10 −0 README.markdown
  2. +4 −0 example/split.js
View
10 README.markdown
@@ -7,6 +7,16 @@ example
=======
``` js
+var splitBy = require('split-by');
+var xs = [ 3, 4, 0, 0, 0, 2, 1, 0, 5, 0, 0, 0, 5, 2, 1 ];
+var res = splitBy(xs, [ 0, 0, 0 ]);
+console.dir(res);
+```
+
+output:
+
+```
+[ [ 3, 4 ], [ 2, 1, 0, 5 ], [ 5, 2, 1 ] ]
```
methods
View
4 example/split.js
@@ -0,0 +1,4 @@
+var splitBy = require('../');
+var xs = [ 3, 4, 0, 0, 0, 2, 1, 0, 5, 0, 0, 0, 5, 2, 1 ];
+var res = splitBy(xs, [ 0, 0, 0 ]);
+console.dir(res);
Please sign in to comment.
Something went wrong with that request. Please try again.