I don't really see how this could be wrong code.
In few examples, there is no output at all or it's only "10" in this one.
var num2 = 10;
while (num2 >= 10 && num2 <= 40 && num2%2===0){
console.log(num2);
num2++;
}
or like this:
var num2 = 10;
while (num2 >= 10 && num2 <= 40){
if (num2%2===0){
console.log(num2);
num2++;
}}