codecamp

JavaScript 函数局部变量定义

function myFunction() {
'use strict';
var myVar='use strict';


console.log(myVar);
}
myFunction();


// run and check the console 
// myVar is not defined outside of myFunction




// now remove the console log line to pass the test
JavaScript 函数全局变量定义
JavaScript 函数全局变量与局部变量差异
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定