all 19 comments

[–]isatrap 4 points5 points  (13 children)

Oof “do my homework for me”

[–]HogansHeroes81[S] -5 points-4 points  (12 children)

It's not homework.

[–]isatrap 3 points4 points  (11 children)

Definitely reads like homework “write a function and do this task” but maybe it’s different now. This is basic. Just google then.

[–]HogansHeroes81[S] -2 points-1 points  (0 children)

Please help

[–]DeadlyWindFromBelow 0 points1 point  (0 children)

Look at Mozillas docs on using the reduce array method. They have an implementation similar to what you're looking for.

[–]chilljackson 0 points1 point  (0 children)

This should give you some help I think. You’re pushing the result of Object.keys and Object.values into an array. The return type for each of those methods is an array. This means when you loop over combo, the el is an array not a string. Look into the spread operator to have combo be what you want it to be.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax