赋值语句的返回值为赋值结果:
let Color = {}; Color[Color["Red"] = 0] = "Red"; console.log('赋值返回值', Color["Red"] = 0 ); //0 console.log('这个对象', Color); // {0: "Red", Red: 0} let test; console.log('变量赋值',test = 666); //666
总结:赋值语句(表达式的值)的返回值为赋值结果!!!
尴尬 我竟然不知道 ^_^