Created
March 3, 2022 07:22
-
-
Save JimOfLeisure/511a1ad18f710180a8900539b3cba649 to your computer and use it in GitHub Desktop.
Figured out the spread syntax after the time expired
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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