Example of inline if in javascript: var a = 30; var b = 40; var c = ((a < b) ? 2 : 3);
Copy / pasted from here.
Example of inline checking of null:
var whatIWant = someString || "Cookies!";