1

I do this from time to time, especially in Javascript to store references to deeply nested properties in objects, but I am not sure on what this would be called. Multiple variable assigning? Variable reference assignment?

myVar = myObject.myProperty = value
0

1 Answer 1

3

Generally known as "chained assignment".

It is also important to differentiate the fact that you're not just assigning multiple variables, but you are assigning the return value of the deeper assignment operation. That is why it is a "chain" rather than some form of combined operation.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.