Returns a an array of the items in coll starting from the first item for which pred(item) returns null/undefined.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.jshintrc
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

Build Status

drop-while

Returns an array of the items in coll starting from the first item for which pred(item) logical false, i.e. false, null, undefined

function dropWhile(coll, pred, ctx) {}

Install

npm i -S drop-while

Usage

var assert = require('assert');
var dropWhile = require('drop-while');
var is = require('is-predicate');

var arr = [-1, -2, -6, -7, 1, 2, 3, 4, -5, -6, 0, 1];
var expect = [1, 2, 3, 4, -5, -6, 0, 1];
assert.deepEqual(dropWhile(arr, is.neg), expect); // true