Skip to content

includes

Subhajit Sahu edited this page May 10, 2020 · 19 revisions

Checks if iterable has a value. 🏃 [:vhs:] 📦 🌔

Similar: keys, values, entries.

iterable.includes(x, v);
// x: an iterable
// v: search value
const iterable = require('extra-iterable');

var x = [1, 2, -3];
iterable.includes(x, 3);
// false

iterable.includes(x, -3);
// true

references

Clone this wiki locally