언어/javascript
자바스크립트 - 함수와 스코프
밍래그로프
2021. 2. 8. 13:15
1
2
3
4
5
6
7
8
|
var x =100;
function f(){
var x =1;
document.write(x); //지역변수
document.write("<br>");
document.write(this.x);// 전역변수
}
f();
|
cs |