News for hackers. Stuff that matters.
Re:JavaScript Quiz Set by prophetjohn on Saturday January 19, 2013 @01:50PM (#5084292)
The above example is at least academically interesting since you can reason through it with a bit of programming experience and intuition about operator precedence.

    Does plus or pre/postfix increment have higher precedence?
    Probably increment.
    Does prefix or postfix have higher precedence?
    They're probably the same -> evaluate from left-to-right.
    Code is equivalent to num1++ + num2;

But the examples like "what is the difference between substring() and substr()", "What is the lowest cross-browser increment that [setInterval()/setTimeout()] can accurately use" is just trivia and is boring.
Re:JavaScript Quiz Set by jonsen on Saturday January 19, 2013 @02:31PM (#5084451)
You also need to know how tokens are produced by lexical analysis. It could have produced:

  'num1' '+' '++' 'num2'
In fact it produces

  'num1' '++' '+' 'num2'
so it's not about evaluate from left-to-right.
Re:JavaScript Quiz Set by prophetjohn on Saturday January 19, 2013 @03:22PM (#5084612)
Is there a case in JavaScript where operators with the same precedence are not evaluated left-to-right?
Re:JavaScript Quiz Set by jonsen on Saturday January 19, 2013 @03:52PM (#5084710)
I don't know. But I happen to know that the javascript tokenizer matches the longest possible substring. Therefore it takes '++' from '+++..', not '+'. It's not about precedence.

EDIT: Yes, the assignment operators, =, += etc., evaluates right to left.