Multiple choice technology performance

With the following code, var x = 10; var y = true; which of the options are slower two ?

  1. if (x*x < 1000 && y) alert("true!");

  2. if (x*x > 1000 && y) alert("true!");

  3. if (y || x*x > 1000) alert("true!");

  4. if (x*x > 1000 || y) alert("true!");

Reveal answer Fill a bubble to check yourself
A,D Correct answer
Explanation

Given x=10 (so x*x=100), option A evaluates both conditions (100<1000 is true, must check y), and option D evaluates both (100>1000 is false, must check y due to OR). Options B and C short-circuit without full evaluation. The question asks which are SLOWER, meaning more evaluations, so A and D are correct.