Files
ihrm/node_modules/collect.js/docs/api/has.md
2023-05-10 15:06:57 +05:30

430 B

has()

The has method determines if one or more keys exists in the collection:

const collection = collect({
  animal: 'unicorn',
  ability: 'magical',
});

collection.has('ability');

// true

collection.has(['animal', 'ability']);

// true

collection.has(['animal', 'ability', 'name']);

// false

View source on GitHub