diff --git a/exercise.js b/exercise.js index da0af63..e25c20b 100644 --- a/exercise.js +++ b/exercise.js @@ -1,2 +1,75 @@ // Good Luck! You got this 💪🏾 // Write your code here. + + + +//funcations + + let country = ("somaliland") + let population = ("3.5M") + let capitalCity = ("Hargaisa") + +function describeCountry(country,population,capitalCity){ + console.log(`${country} has ${population} people and its capital city is ${capitalCity}`) +} + + + + describeCountry("somaliland", "3.5million" , "hargeisa") + + +/ + + + + + + + + + + + function percentageOfWorld1(population){ + console.log(`china has ${population}million people, so its about ${population / 7900 * 100}% of the world population` ) + } + + percentageOfWorld1(1441) + + + + + + + + + const populations = ("qarat","kuwait","oman","saudi") + console.log(population.lenght) + + + + let neighbours = ["ethiopia","Somalia","sudan"] + console.log(neighbours) + + for(let i = 0; i < neighbours.length; i++){ + console.log("true") } + for(let i = 0; i > neighbours.length; i++){ + console.log("true") + } + + + for(let i=1; i<5; i++){ + console.log(i) + } + + let neighbours = ["ethiopia","Somalia","sudan"] + console.log(neighbours.length) + for(let i=0; i<5; i++){ + console.log(neighbours[i]) + } + +let neighbours = ["ethiopia","Somalia","sudan"] +let i=0 +while(i<=5){ + console.log(neighbours[i]) + i++ +} diff --git a/index.html b/index.html index 2453cbf..f05dc50 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,11 @@