Tell us what’s happening:
The output of my function looks correct to me, but I’m failing the second test. Am I missing something obvious? I can’t tell what is wrong on my code.
**Your code so far**
function orbitalPeriod(arr) {
var GM = 398600.4418;
var earthRadius = 6367.4447;
function objPeriod(altitude) {
return Math.round((Math.sqrt(Math.pow((earthRadius + altitude), 3) / GM)) * 2 * 3.14159)
}
return arr.map(obj =>({name: obj.name, orbitalPeriod: objPeriod(obj.avgAlt)}));
}
orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]);
**Your browser information:**
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:78.0) Gecko/20100101 Firefox/78.0
.
Challenge: Map the Debris
Link to the challenge: