marpple / FxTS

A functional programming library for TypeScript/JavaScript
https://fxts.dev
Apache License 2.0
881 stars 63 forks source link

fix: dropUntil.ts example #272

Closed hg-pyun closed 5 months ago

hg-pyun commented 5 months ago

As-Is

// The example answer is 3, 4, 5, but the correct answer is 2, 3, 4, 5, 1, 2 
const iter = dropUntil((a) => a < 3, [1, 2, 3, 4, 5, 1, 2])

To-Be

I think it is a mistake copying and pasting dropWhile. Considering the context, I think it's the right way to change it as follows.

const iter = dropUntil((a) => a > 3, [1, 2, 3, 4, 5, 1, 2]);