Files
ihrm/node_modules/collect.js/docs/api/flip.md
Nikhil Ravi Cybrosys e1794e7422 [UPDT]translations in the views (#4)
[UPDT]Translations in the views
[FIX]major bug fixes
2023-05-18 15:05:28 +05:30

404 B
Executable File

flip()

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

const collection = collect({
  name: 'Darwin Núñez',
  number: 27,
});

const flipped = collection.flip();

flipped.all();

// {
//   'Darwin Núñez': 'name',
//   '27': 'number',
// }

View source on GitHub