Struggling with understanding JavaScript syntax. Can someone explain to me why this line of code works:
console.log($rootScope.wg.variable1);
But the following line doesn't (resulting in undefined
):
console.log($rootScope.wg.variable+1);
I've experimented with different syntax options but haven't been able to find one that works correctly yet.