Referencing the document class can be done in two ways. The first example uses brackets and a string. The brackets allows whatever is inside it to be ignored at compile time and used at runtime. If dot notation was used the compiler would try to find the function. It wouldn’t find the function and you would get a compiler error. The brackets hide it from the compiler and this is taken care of at runtime instead. The string, or the text in quotes, inside means that it is handled literally, letter for letter. This technique can also be used with a variable. This could be helpful if getting information at runtime. For example, if you are retrieving the name of a function from an external data source such as a XML file.
//example 1 root["functionReference"]();
The second example uses the Document Class name. This is very similar to dot syntax except the root keyword is put in parenthesis after the Document Class name. This technique can be used with properties and methods in the Document Class.
//example 2 DocumentClass(root).functionReference();