function orbitalPeriod(arr) {
	const GM = 398600.4418;
	const earthRadius = 6367.4447;
	arr.forEach(function(element) {
		let object = element.name;
		let altitude = element.avgAlt;
		// calculate the Orbital Period of current element
		let OP = orbitalPeriodOf(altitude, GM, earthRadius)
		// delete average altitude
		delete element.avgAlt;
		// add orbital period
		element.orbitalPeriod = OP;
	});
	return arr;
}
// The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418 km3s-2.
The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418 km3s-2.
The radius of the earth is 6367 . 4447 kilometers and the GM value of earth is 398600 . 4418 km3s - 2 .
function orbitalPeriod(arr) {
	const GM = 398600.4418;
	const earthRadius = 6367.4447;
	arr.forEach(function(element) {
		let object = element.name;
		let altitude = element.avgAlt;
		let OP = orbitalPeriodOf(altitude, GM, earthRadius)
		delete element.avgAlt;
		element.orbitalPeriod = OP;
	});
	return arr;
}
function orbitalPeriod ( arr ) { const GM = 398600.4418 ; const earthRadius = 6367.4447 ; arr . forEach ( function ( element ) { let object = element . name ; let altitude = element . avgAlt ; let OP = orbitalPeriodOf ( altitude , GM , earthRadius ) delete element . avgAlt ; element . orbitalPeriod = OP ; } ) ; return arr ; }
The radius of the earth is 6367.4447 kilometers, and the GM value of earth is 398600.4418 km3s-2.
The radius of the earth is 6367 . 4447 kilometers and the GM value of earth is 398600 . 4418 km3s - 2 .
// calculate the Orbital Period of current element // delete average altitude // add orbital period