Yes. They are almost exactly identical.
Both will appreciate b first. If he is truthful, he will return b . Otherwise, it will return c .
As pointed out by @thesystem, if you have a getter method on b , it will be called twice for triple, but only once for the or operator.
Test it using the following snippet:
var o = {}; o.__defineGetter__("b", function() { console.log('ran'); return true; }); var d = ob || o.not; console.log('-----'); var d = ob ? ob : o.not;
Here's the fiddle: http://jsfiddle.net/bqsey/
source share