Access variable outside function scope [duplicate]

You redeclare gsd as a new variable inside your function. Remove var in front of gsd inside the function to address the gsd in the outer scope.

Leave a Comment