drop-while

v0.9.6arrow_drop_down
v0.9.6
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
1 KB
Returns a new list excluding the leading elements of a given list which satisfy the supplied predicate function.
1 contributor
Install drop-while as a package?
Copied
npm i @bit/justin-capalbo.ramda.drop-while
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
No preview available
modifieddraft
chevron_left
chevron_right
dropWhile (
fn:Function,
xs:Array
) : Array

Returns a new list excluding the leading elements of a given list which satisfy the supplied predicate function. It passes each value to the supplied predicate function, skipping elements while the predicate function returns true. The predicate function is applied to one argument: (value).

Dispatches to the dropWhile method of the second argument, if present.

Acts as a transducer if a transformer is given in list position.

Example
const lteTwo = x => x <= 2;

     R.dropWhile(lteTwo, [1, 2, 3, 4, 3, 2, 1]); //=> [3, 4, 3, 2, 1]

     R.dropWhile(x => x !== 'd' , 'Ramda'); //=> 'da'
Arguments
fn: Function

The function called per iteration.

xs: Array

The collection to iterate over.

Returns
Array

A new array.

Help and resources