What does the || (logical OR, double vertical line) operator do with non-boolean operands?
05:49 04 Sep 2009

I am using a large JS library to perform certain drawing operations in canvas. Reviewing the library code (to make accommodating changes), I have run into the || operator being used in a fashion which certainly should not evaluate to Boolean. Does this mean that this is a different operator or am I missing something obvious? An example follows:

var $time = Date.now || function() {
  return +new Date;
};
javascript or-operator truthiness