You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Saurabh3333 it's not a good practice. Global variables are available everywhere in JavaScript, they needn't be passed around as function arguments. It also makes following the code harder for anyone who hasn't worked with JavaScript before. Questions like "If the variable is available everywhere, why is it being passed as a function argument? Is there some reason I am missing?"
It's messy, of course. I shouldn't have used global variables in the beginning, when I was designing this module. I ended up using them. So, I think the second best option, after completely refactoring index.js, is to embrace the fact that index.js has global variables!
No description provided.
The text was updated successfully, but these errors were encountered: