Logical operations in JavaScript

f