예, 가능합니다. 전역 범위가 있는 경우 변수를 선언하지 않고 사용할 수 있습니다. 다음 "no var" 변수 "points"는 범위 체인을 살펴보고 wince var 키워드는 사용하지 않습니다 -
<html>
<body>
<script>
var rank = 5;
points = 50;
marks = 300;
// Anonymous function
(function() {
points = 100; //overwrites global scope points
var rank = 4; //new rank variable is created in this' function's scope
var marks = 900;
document.write(rank+"\r\n"); //prints 4
document.write(points+"\r\n"); //prints 100
document.write(marks+"\r\n"); //prints 900
})();
document.write('<br/>');
document.write('<br/>');
document.write(rank+"\r\n"); //prints 5
document.write(points+"\r\n"); //prints 100
document.write(marks+"\r\n"); //prints 300
</script>
</body>
</html>