Javascript多赋值语句 [英] Javascript multiple assignment statement

查看:100
本文介绍了Javascript多赋值语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在某些代码中看到了该行

I saw that line in some code

window.a = window.b = a;

它是如何运作的?

以下内容总是返回true吗?

Does the following always return true?

window.a == a

推荐答案

这意味着

window.b=a;
window.a=a;

或者你可以说。

window.b=a;
window.a=window.b;

单个参数中的两项作业


还有一件事

And one more thing

window.a == a right?

window.a==a right?

是的,这是对的。它将返回true

yes this is Right. It will return true

这篇关于Javascript多赋值语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆