# keys()

The keys method returns all of the collection's keys:

const collection = collect([
  {
    club: 'Liverpool',
    nickname: 'The Reds',
  },
]);

keys = collection.keys();

// ['club', 'nickname']

View source on GitHub (opens new window)