JavaScript Challenge - 7

 Create a function that takes a country's name and its area as arguments and returns the area of the country's proportion of the total world's landmass.

------------------------------------------------------------------------------------------------------------

 

let world_land = 148940000;  // (in KM. square)

function areaOfLand(country, area){
     let country_area = ((area/world_land)*100).toFixed(2);
     let result = "Area of "+country+" is "+country_area+" % of the total Land Mass";
     console.log(result);
}
areaOfLand("India", 2973190);

Comments

Popular posts from this blog

Average of All Indexes of Array

JavaScript Coding Challenge-8

Largest and Lowest Number of the Array using JavaScript