Tuesday, 4 October 2016

How to assign local variable value to global variable in JavaScript?

I often face this problem while using callback functions.
I want to store local variable value to global variable value  OR
I want to fetch value got in callback function outside the function scope.

Finally I found a Solution.

Use String to append the object  in callback function and extract global variable outside the scope of function.

Refer below image:






No comments:

Post a Comment