js中赋值表达式的值为右边

var name="the window";
var o={
name:"the object",
getName:function(){
console.log(this.name);
}
};
o.setName=function(){
console.log(this.name);
var n=function(){
console.log(this.name+"123123");
};
(o.getName=n)();//the window123123
};
o.getName();//the object123123
(o.setName)();//the object

原文地址:https://www.cnblogs.com/yhf286/p/4830096.html