I want to print all even numbers between 10 and 40. But what’s wrong with my code?
code:
console.log("Print all even number between 10 and 40");
var num = 10;
while(num%2 == 0 && num < 40){
console.log(num);
num ++;
};
When I run in on console it’s just print 10 
sanity
2
Notice what happens when num is incremented to 11, does the while condition is still met? If not then the loop will end.
Oh ya 
Now it’s working well!
console.log("Print all even number between 10 and 40");
var num = 10;
while(num <= 40){
if(num%2 === 0){
console.log(num);
};
num ++;
};
Thank you!
Also if you want to include the number 40 I would add <=
It’s more efficient 
var num = 10;
while(num <= 40){
console.log(num);
num += 2;
};