<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<h2>index3.html 파일</h2>
<script>
function example() {
if (true) {
let x = 10;
console.log(x);
}
console.log("----------------");
console.log(x);
}
example();
</script>
</body>
</html>
'JS > 시나리오 코드' 카테고리의 다른 글
배열 (0) | 2024.07.19 |
---|---|
객체 리터럴 표기법 (0) | 2024.07.19 |
new 키워드와 생성자 함수 (0) | 2024.07.19 |
var 키워드와 호이스팅 (0) | 2024.07.19 |
형 변환 (0) | 2024.07.19 |