+ 1
What is the output of this code? var _run=0 ; function _runchange(){ var _run=1;} console.log(_run);
7 Answers
+ 3
good luck
+ 2
it is 0 because you declared a new variable called _run with the same name with the global variable
so it will not affect on the global even if you call _runchange function
to access global variable use window object
example:
window._run=5;
this makes the global _run equals to 5
+ 2
which one?
+ 2
I'm coding a browser app(interractive) . Where i will learn javascript from its first released version in 20th century to the last version . I will note features from each version. In this project my programming skills is being greather.
+ 2
Thanks
+ 1
I made this mistake on my project
+ 1
It's my current project