Javascript if Statement Question 5

Introduction

Odds 1 - 255

Print all odd integers from 1 to 255

function odds255() {
  for (var i = 1; i <= 255; i++) {
    //your code here
      console.log(i);
    }
  }
}
odds255();



function odds255() {
  for (var i = 1; i <= 255; i++) {
    if (i % 2 == 1){
      console.log(i);
    }
  }
}
odds255();



PreviousNext

Related