What would you call using multiple dot notation's to a variable?
i.e: e.target.style.textDecoration
I've tried to Google search for an answer but not sure exactly how to word the question. Plus I would like to get familiar with asking questions on stackoverflow.
Chaining
It's called
Chaining.In JavaScript, chaining refers to the technique of calling multiple methods on an object one after the other, in a single line of code. The result of one method call is used as the object on which the next method call is made, and so on, creating a chain of method calls.
Literally you are creating chains of calls!
Chaining can make code more concise and easier to read, as it avoids the need to create temporary variables to store intermediate results.
Here is a full article about it
For your Example:
Variable
eis an object andtargetproperty of that is an object too. thenstyleis a property ofe.targetand so on.Method Chaining
This can be done for methods, too. If the method return type be an
object.For instance:
Also there is A new operation you can check it out. It's called Optional Chaining It checks parent not to be null. So no error will be issued if parent is null or non-object. MDN Documentation