We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
var a = 1 < 2 < 1 < 1 ? 3 : 4; var b = 3 < 2 < 1 < 1 ? 2 : 1; console.log(a); console.log(b);
The text was updated successfully, but these errors were encountered:
答案:3 1 解析:大于小于运算符优先级高于三目运算符,且从左往右执行 a的执行顺序如下: 第一步:1 < 2 为true 第二步:true < 1,这时true会转为1,false会转为0进行比较,因此这一步结果为false 第三步:fasle < 1,结果为true,因此a的结果是3 b的结果同理于a,不再写详细计算步骤。
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: