dev*_*-cc 1 javascript operators
我在测试中看到了这个问题,但我不明白运算符如何处理该语句.
let a = ~-(2 + "2");
console.log(a);Run Code Online (Sandbox Code Playgroud)
~-(2 + "2")
Run Code Online (Sandbox Code Playgroud)
2 + "2"连接)="22"-"22"强制)=-22~-22按位NOT)= - ( - 22 + 1)= 21按位注意任何数字x的产量 - (x + 1).例如,〜-5产生4.