I don't think you need to care about the performance here. The || oerpator should be slightly faster but compared to the slow DOM code browsers have it is just a drop in the ocean.The expressions are not identical because that would break semantics. When using the ternary oerpator the expression is executed twice. Here is a test case that shows that they are different:var c = 0;function f() { return c++;}var a = f() || a'; // a'var b = f() || b'; // 1// resetc = 0;a = f() ? f() : a'; // a'b = f() ? f() : b'; // 2