Tell us what’s happening:
My output is identical (save for the type of quotes), and yet the solution doesn’t pass. It looks like something that has to be fixed. If I need to tag some staff members, please let me know
Your code so far
function orbitalPeriod(arr) {
const GM = 398600.4418;
const earthRadius = 6367.4447;
const resArr = [];
let name;
for (let i = 0; i < arr.length; i++) {
name = arr[i].name;
orbitalPeriod = Math.round(
2 * Math.PI * Math.sqrt(
Math.pow(arr[i].avgAlt + earthRadius, 3)
/ GM
)
);
resArr.push({
name,
orbitalPeriod
});
}
return resArr;
}
const res = orbitalPeriod([{name: "iss", avgAlt: 413.6}, {name: "hubble", avgAlt: 556.7}, {name: "moon", avgAlt: 378632.553}]);
console.log(res);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 YaBrowser/23.3.4.594 Yowser/2.5 Safari/537.36
Challenge: Intermediate Algorithm Scripting - Map the Debris
Link to the challenge: