# Intermediate Algorithm Scripting: Map the Debris

Tell us what’s happening:
My value is still far of the solution. And, how can I take update the object? I want to remove avgAlt and set orbitalPeriod.

How may I set a new property in arr?

``````
function orbitalPeriod(arr) {
var GM = 398600.4418;

for(let i=0;i<arr.length;i++){

delete arr[i]["avgAlt"];

return arr,orbitalPeriod
}

}

orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]);
``````

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36`.

Challenge: Map the Debris

Your orbital period calculation is very wrong. What formula are you using?

1 Like

1 Like

How can I do with that a? That is the orbit, but i have the average altitude and Earth ratio. Does myself has to add them?

That is he equation that I used.

That is the same formula, but you did not code it correctly.

There is no cubed value in your code, you have an extra addition in the numerator in place of an multiplication, and you are not dividing the entire numerator by `gm`.

You would calculate the `a` the same way you computed `r`.

1 Like

How may I set a orbitalPeriod in the object. I tried with push, but it is next to the object. It is not inside the object.

``````function orbitalPeriod(arr) {

var GM = 398600.4418;

let arreglo=[]

for(let i=0;i<arr.length;i++){

delete arr[i]["avgAlt"];

}

}

orbitalPeriod([{name : "sputnik", avgAlt : 35873.5553}]);``````
``````function orbitalPeriod(arr) {
var GM = 398600.4418;

let arreglo=[]

for(let i=0;i<arr.length;i++){

arreglo.push({name: arr[i]["name"],orbitalPeriod})
}

return arreglo
}

orbitalPeriod([{name: "iss", avgAlt: 413.6}, {name: "hubble", avgAlt: 556.7}, {name: "moon", avgAlt: 378632.553}]);``````

I am thankful for your time