Here I have two examples of accessing global variables; basic example of my global variable
globalVar:any={
a:5,
b:3,
c:4
}
Ex.1
function accesVar(){
return this.globalVar.a*=2
}
Ex.2
function accesVar(){
let _var=this.globalVar.a;
return _var*=2
}
In this example global variable doesnt seem a good practise and I dont use them when I dont need to share variables with more than one function.Considering in general and real world(much bigger data),which would be best approach and has better performance?