I have a global js variable defined below (@Url is an ASP.Net MVC html helper it will get converted to a string value):
Within your component you could reference window to access the global variables like so:
rootVar = window["rootVar"];
or
let rootVar = window["rootVar"];