akmalist / JavasSctipt-basic-algoritms

FreeCodeCamp tests
0 stars 0 forks source link

Write a for loop that will iterate from 0 to 20. For each iteration, it will check if the current number is even or odd, and report that to the screen (e.g. "2 is even"). #10

Open akmalist opened 5 years ago

akmalist commented 5 years ago

for (let i=0; i<=20; i++){
  if (i%2===0){
    console.log(i+' is even')
  } else {
    console.log(i+ ' is odd')
  }
};