理解javascript运算符

let res = 3 % -10
console.log(res)  // 3

取余数运算中,如果右侧数值小于左侧,则结果为左测数值


let res = 2 * 2 * undefined
console.log(res) // NaN

undefined在转化为数值类型时是NaN


let a = 5, b, c;
b = a = c
console.log(a, b, c) //undefined undefined undefined

赋值运算符遵行右结合性,从右向左开始赋值

原文地址:https://www.cnblogs.com/webmc/p/13993292.html