Toggle navigation
Genres
Frontend (2)
JavaScript (6)
Database (2)
Linux Server (3)
Web Apps (4)
Misc (4)
Search
List
New Tutorials
Last Modified Tutorials
</>
Code examples
code
smiko
javascript
advanced
functions
06fun_global_var_in_function.js
06fun_global_var_in_function.js
/** * Inside function global variable is defined without 'var' * Each global variable is accessible inside function, and it's nested functions. * */ //global variable inside function is accessible in another function function fja1() { a = 8; } function fja2() { console.log(a); } fja1(); //puts a in global scope fja2(); //invoke console.log();
Reload page
Preview
W3C validation
Edit Code
JS Console