Hello all. I'm currently working on "Map the Debris" under Advanced Algorithm Scripting.

Can anyone tell me how to correctly round the results? I think my code is correct (for finding the orbital period and returning it as a hash nested inside an array), however, rounding the orbital period is off. It seems freecodecamp is using different rounding techniques?

for example, for sputnik, the result is 86397.158, and they round it off to 86400 (I can write the code to round it off this way)however, for iss, the result is 5557.034, and they round it off to 5557 (I can also write the code to round it off this way as well)further, for hubble, the result is 5733.86, to which they round off to 5734.

I'm confused. How exactly should I round off the results here? The instructions says to round off to the nearest whole number. The nearest whole number for 86397.158 to me is 86397, but they rounded off to 86400.

@zifahm When an object is used in comparison with a number the JS engine first calls the object‘s „valueOf“ method. In this case it first returns „1“ and on the second comparison is called again, returning „2“

@zifahm Abstract equality algorithm uses an internal ToPrimitive function on the object on the left side which coerces the object into a primitive value. It calls the valueOf method it is exists and toString method if valueOf doesn't exist. Here it uses valueOf like @nusli said.

@artoodeeto so, you needed to push the center from the margins by 50% and translate it x and y by half of height and width (50px) and thats it -25px. ofc if you make the center lets say 100px you would need to chage the -25px into -50px

@zifahm As the abuseCoercion property name suggests, you're basically using a hack to make it so that every time you check the "value" of a, it goes up. Using == instead of === is also vital here because, as you can see, a is actually an object, not a number

hey guys, can someone give me a little hand with "Wherefore art thou"? Im kinda stuck for a while now and I tried to just make an "exercise specific" code to solve the problem, but it also didn't work.here's the code: