1. After omitting Var, the variable has global scope
When reading a book, I see that if you omit the var keyword from the function, the variable will automatically have the global scope.
function Showscope () {
Scope= ' local ';
return scope;
}
Console.log (scope);//Report Scope undefined error
Here, you define a variable in the Showscope function, does not use scope, but can not find the function, and later found that because the function is not running at first, only after the call once the code is executed, so the natural direct output scope will be an error.
So here's a little pit to call the function once before you can use this global variable. And if there is already a global scope variable, after calling the Showscope function, the ' local ' assignment to scope actually re-alters the value of scope.
function Showscope () {
Scope= ' local ';
return scope;
}
Console.log (Showscope ());//local
Console.log (scope);//local
2. After the editor is transferred from sublime text to Webstorm
After the editor goes from sublime text to Webstorm, the browser address bar is found by the previous file:///... Became localhost:63342/..., and webstorm the previous level of the Webstorm directory under the relative path access setting will also error.
This is because sublime directly open the page, and Webstorm comes with a small server, it is the small server to open the page, set up the Webstorm project directory, you can only access the contents of the directory, and do not jump out of this directory to access other content.
A little understanding of the individual is not yet known whether it is correct
20160109 minor Problems