O'Reilly logo
  • Tony Nguyen thinks this is interesting:

var a = 42; var b = (a > 41) ? "hello" : "world"; // similar to: // if (a > 41) { // b = "hello"; // } // else { // b = "world"; // }

From

Cover of You Don't Know JS: Up & Going

Note

As of 9/30/2018, this example did not work for me. :(