my-idlers/node_modules/collect.js/docs/api/has.md
cp6 fd22b0bf58 V2 (Laravel re-make)
V2 (Laravel re-make)
2022-03-06 02:02:12 +11:00

24 lines
407 B
Markdown

# `has()`
The has method determines if one or more keys exists in the collection:
```js
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](https://github.com/ecrmnn/collect.js/blob/master/src/methods/has.js)