javascriptassignment-operator

How does assignment chaining (as in `a = b = ...`) work?


I saw that line in some code

window.a = window.b = a;

How does it work?

Does the following always return true?

window.a == a


Solution

  • it means

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

    OR You can say.

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

    two assignments in a single statment

    and

    And one more thing

    window.a==a right?

    yes this is Right. It will return true