You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
357 B

4 years ago
  1. # `pull()`
  2. The pull method removes and returns an item from the collection by its key:
  3. ```js
  4. const collection = collect({
  5. firstname: 'Michael',
  6. lastname: 'Cera',
  7. });
  8. collection.pull('lastname');
  9. // Cera
  10. collection.all();
  11. // { firstname: 'Michael' }
  12. ```
  13. [View source on GitHub](https://github.com/ecrmnn/collect.js/blob/master/src/methods/pull.js)