Nested Parenthetical Madness
Miss any of our Open RFC calls?Watch the recordings here! »

@extra-object/scan-until.min

2.2.3 • Public • Published

Finds key of first entry passing a test. 🏃 📼 📦 🌔 📒

Alternatives: scanWhile, scanUntil.
This is part of package extra-object.

This is browserified, minified version of @extra-object/scan-until.
It is exported as global variable object_scanUntil.
CDN: unpkg, jsDelivr.

object.scanUntil(x, ft);
// x:  an object
// ft: test function (v, k, x)
const object = require('extra-object');
 
var x = {a: 1, b: 2, c: 3, d: 2};
object.scanUntil(x, v => v % 2 === 0);
// 'b'         ^
 
object.scanUntil(x, v => v % 8 === 0);
// null

references

Install

npm i @extra-object/scan-until.min

DownloadsWeekly Downloads

33

Version

2.2.3

License

MIT

Unpacked Size

8.24 kB

Total Files

19

Last publish

Collaborators

  • avatar