Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions exercise.js
Original file line number Diff line number Diff line change
@@ -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++
}
7 changes: 6 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Js exercises</title>
</head>
<body></body>
<body>




</body>
<script src="./exercise.js"></script>
</html>