Skip to content

Instantly share code, notes, and snippets.

@jackz3
Created May 9, 2012 14:46
Show Gist options
  • Save jackz3/2645022 to your computer and use it in GitHub Desktop.
Save jackz3/2645022 to your computer and use it in GitHub Desktop.
variable1 = 1; //全局范围
var variable2 = 2; // 不在一个函数内: 全局范围
function funcName() {
variable3 = 3; // 没用var关键字声明: 全局范围
var variable4 = 4; //仅本地访问
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment