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.

22 lines
521 B

4 years ago
  1. # `diffKeys()`
  2. The diffKeys method compares the collection against another collection or a plain object based on its keys. This method will return the key / value pairs in the original collection that are not present in the given collection:
  3. ```js
  4. const collection = collect({
  5. a: 'a',
  6. b: 'b',
  7. c: 'c',
  8. d: 'd',
  9. });
  10. const diff = collection.diffKeys({
  11. b: 'b',
  12. d: 'd',
  13. });
  14. diff.all();
  15. // { a: 'a', c: 'c' }
  16. ```
  17. [View source on GitHub](https://github.com/ecrmnn/collect.js/blob/master/src/methods/diffKeys.js)