Skip to content

Base Contains

Malexion edited this page Oct 31, 2016 · 2 revisions

__.contains(obj, func)

  • obj Item to iterate over.
  • func Object/Function used to discover if the item exists within the given iterable target.

Examples

console.log(__.contains('a0sfas0fstrf0odsjnf', 'str'));

console.log(__.contains([ 1, 3251, 32, 0], 32));

console.log(__.contains([ 1, 3251, 32, 0], -1));

console.log(__.contains([ 1, 3251, 32, 0], (value, key) => key == 4));

console.log(__.contains({ key: 'value', fish: 1 }, value => value == 1));

console.log(__.contains({ key: 'value', fish: 1 }, (value, key) => key == 'key'));
Clone this wiki locally