Condition 1
for( var i = 0; i < 1000; i++ ) {
if( i != 0 ) {
console.log("i is not zero.!");
} else {
console.log("i is zero.!");
}
}
Condition 2
for( var i = 0; i < 1000; i++ ) {
if( i == 0 ) {
console.log("i is zero.!");
} else {
console.log("i is not zero.!");
}
}
Which method is preferable ( I mean more appropriate ).?
Is there any performance difference between those two.?