Javascript examples for Data Type:Variable Scope
Access variables in closures if there are local variables with the same name
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {/* www. ja v a2s . c o m*/ function outerFunction(s) { var someString = 'Hai!'; function innerFunction() { var someString='Hello'; console.log(someString); } innerFunction(); } outerFunction(); }); </script> </head> <body> </body> </html>