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.
 
 
 

380 B

flip()

The flip method swaps the collection's keys with their corresponding values:

const collection = collect({
  name: 'Steven Gerrard',
  number: 8,
});

const flipped = collection.flip();

flipped.all();

// {
//   'Steven Gerrard': 'name',
//   '8': 'number',
// }

View source on GitHub