Okay, so I have pasted my code below, and I need some help figuring this out I’m not looking for a code solution. I’ve handled all the calculations and the values returned are correct. The only difference I have noted is that the expected results all have unquoted Object keys, I don’t even know if that’s possible.
var GM = 398600.4418;
var earthRadius = 6367.4447;
function orbitalPeriod(arr) {
var finalArr = [];
arr.forEach(function(obj){
let OP = orbitalP(obj.avgAlt);
delete obj.avgAlt;
obj.orbitalperiod = OP;
finalArr.push(obj);
});
return finalArr;
}
function orbitalP(alt){
var OR = earthRadius + alt;
var OP = 2 * Math.PI * (Math.pow((Math.pow(OR, 3)/GM),0.5));
return Math.round(OP);
}
So that’s my code, it works fine but I just can’t seem to pass the tests. Any assistance is welcome.