Skip to main content
Module

x/fae/mod.ts>dropLastWhile

A functional module for Deno inspired from Ramda.
Latest
variable dropLastWhile
import { dropLastWhile } from "https://deno.land/x/fae@v1.1.1/mod.ts";

Returns a new list excluding the trailing elements of a list which satisfies predicate. Skips all the elements which on applied on predicate returns true. The new list ends with last false.

Acts as a transducer if a transformer is passed in place of list

 const lteThree = x => x <= 3;
 Fae.dropLastWhile(lteThree, [1, 2, 3, 4, 3, 2, 1]); //=> [1, 2, 3, 4]
 Fae.dropLastWhile(x => x !== 't' , 'dispatch'); //=> 'dispat'

type

DropLastWhile