logoalt Hacker News

sheept • today at 8:23 AM • 0 replies • view on HN

JavaScript does something similar for the exponentiation operator. This is a syntax error:

    -a ** b
Someone who learned PEMDAS in school may argue it should be equivalent to -(a * b), while a programmer may be used to unary operators binding tightest, so (-a) * b.