Mysql or/and precedence?

The MySQL documentation has a good page with information on which operators take precedence. From that page, 12.3.1. Operator Precedence Operator precedences are shown in the following list, from highest precedence to the lowest. Operators that are shown together on a line have the same precedence. INTERVAL BINARY, COLLATE ! – (unary minus), ~ (unary … Read more

Operator precedence with Javascript Ternary operator

h.className = h.className + (h.className ? ‘ error’ : ‘error’) You want the operator to work for h.className, better be specific about it. Of course, no harm should come from h.className += ‘ error’, but that’s another matter. Also, note that + has precedence over the ternary operator: JavaScript Operator Precedence