黑马程序员技术交流社区

标题: day080427-JS [打印本页]

作者: Wendy0518    时间: 2019-6-20 19:57
标题: day080427-JS
in JS, within a function, if use the same variable name as defined in global before without var declaration, it means that you're using the same global variable and change its value. but in Python, within a function, you need to make a declaration as Global Variable.

in JS, Prefixing a variable with var defines a new variable. Omitting var updates an existing variable. (you should always use var to define a new variable)




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2