Do if/else statements affect performance?
Edit: Okay this is ridiculous
What your colleague is likely referring to is that in some cases assigning a variable every time is faster than checking some condition and then assigning it.
var a = 2;
function slower() {
if (a !== 0)
a = 0;
}
function faster() {
a = 0;
}
Really though, it is pretty ridiculous to consider performance impact of a single if
statement considering how powerful today's computers are.