JavaScript exponentiation unary operator design decision
问题 So I was fooling around with the new exponentiation operator and I discovered you cannot put a unary operator immediately before the base number. let result = -2 ** 2; // syntax error let result = -(2 ** 2); // -4 let x = 3; let result = --x ** 2; // 4 From the documentation on MDN: In JavaScript, it is impossible to write an ambiguous exponentiation expression, i.e. you cannot put a unary operator ( + / - / ~ / ! / delete / void / typeof ) immediately before the base number. In most