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
Post a Comment