PDA

View Full Version : force an object



wjrasmussen
11-01-2012, 10:38 PM
I found this piece of code in jquery-1.8.2.js:



// Force options to be an object
options = options || {};


How does this force an object?

WolfShade
11-01-2012, 10:57 PM
It's a conditional statement.

options equals options (if supplied) OR object (if options not supplied).