var x = 1;
var y = 2;

if (x < y) {
  // Do some stuff here
  var z = x + y;
}
else {
  var z = y - x;
}
alert(z);
