Orbital period test

Yep this is a perfect use case for .map (just realised it’s also in the challenge’s title).

i also redid it in the for loop method and it also worked, i tried it the first time and it didnt work but i guess i must of typoed somewhere and couldnt find it.

oh i know what it was. i didnt put the {} when i pushed into the new array. i realize that u need that when pushing an object into an array.

It’s nothing to do with pushing to an array though, the curly brackets {} are just how objects are written in JavaScript.

oh i see. that makes sense

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.