flip()
: The flip() method swaps the collection's keys with their corresponding values:const collection = collect({
name: 'Free Time Learn',
number: 31,
});
const flipped = collection.flip();
flipped.all();
// {
// 'Free Time Learn': 'name',
// '31': 'number',
// }