Example of inline if in javascript:

var a = 30;
var b = 40; v
ar c = ((a < b) ? 2 : 3);

Copy / pasted from here.

Example of inline checking of null:

var whatIWant = someString || "Cookies!";

Copy / pasted from here.