Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
I think it is guaranteed that is only called once. First we have [6.4.2 (1)] (the non-integral stuff does not apply here), and The value of a condition that is an expression is the value of the expression The value of the condition will be referred to as simply “the condition” where the usage is unambiguous. [6.4 (4)] That means in our case, the "condition" is just a plain value of type , not . is only used to find the value for the condition.
You are right that objects are passed by reference and any change made to the object in the function will be reflected everywhere. This is precisely why adding the x property in the function modified the object outside of it. What you are missing is that the line a = b; does not modify the object, it modifies the reference to the object.
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.