In some cases, I see aliases to reduce the search chain, but in this case it is a simple single-line alias without reduction.
var root = this;
I think it is thismore descriptive, as it points to windowthe browser or to many different global variables if JavaScript is server-side.
If it was supposed to be aliased, I feel like
var global = this;
will be more descriptive.
Why is the word used root? I heard that root is used in the context of the "root user", but in the context of JavaScript development, I do not understand.
user3293653
source
share