You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above returns something like "{ odd: 21, sum: 24 }" dependent upon provided args.
I really appreciate the method of setting a key based on the number provided as in the even or odd property. Although 'sum:' is not a sexy new ES6 declaration, seeing it side by side with the even or odd result shows how flexible this new tech is.
Otherwise, really enjoying this workshop!
The text was updated successfully, but these errors were encountered:
Remember that a run of the program with the official solution and the same input you loosely mentioned would give the object { "odd": 21, "24":"24 }, so its not exactly the same as the solution you posted (ES6 style or not). True, the code looks clunky and something you wouldn't want to write or look at, but I think the exercise does a good job in its intention: try to write this weird object without using the var keyword. Maybe this could be written as a hint in the problem text to be more clear.
So, this exercise could be done with a scenario with a prettier code solution, but it does prove the point.
This is merely an opinion: having to type out
seems far too redundant to be a correct answer.
The above returns something like "{ odd: 21, sum: 24 }" dependent upon provided args.
I really appreciate the method of setting a key based on the number provided as in the even or odd property. Although 'sum:' is not a sexy new ES6 declaration, seeing it side by side with the even or odd result shows how flexible this new tech is.
Otherwise, really enjoying this workshop!
The text was updated successfully, but these errors were encountered: