Skip to content

Instantly share code, notes, and snippets.

@JimOfLeisure
Created March 3, 2022 07:22
Show Gist options
  • Save JimOfLeisure/511a1ad18f710180a8900539b3cba649 to your computer and use it in GitHub Desktop.
Save JimOfLeisure/511a1ad18f710180a8900539b3cba649 to your computer and use it in GitHub Desktop.
Figured out the spread syntax after the time expired
function orderFood(list) {
return list.reduce((a, {meal}) => ({...a, [meal]: a[meal] + 1 || 1}), {});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment