Jam's story
[JS] Boolean 본문
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SS16 2022. 6. 3. - 오후 4:35:40</title>
<link rel="shortcut icon" type="image/x-icon" href="../images/SiSt.ico">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>
<body>
<h3>ex08.html</h3>
<script>
// js Boolean true/false
// Boolean() 함수 true/false 반환하는 함수
// alert ( Boolean("null") ) // true
// alert ( Boolean( 3.14 ) ) // true
// 100, 3.14, "HELLO" , 7+4+6 , 10>9 ==> true 가치가 있는 모든 것은 true 이다.
/* ----- js 에서 false 인 경우 ----
let x = 0;
x = -0;
x = null;
x = "";
let x ; undefined
10/ "hello" NaN false
alert( Boolean( x ) ); // js 0은 false 이다.
*/
</script>
</body>
</html>
js에서 0은 false 이다 .
'WEB > JavaScript' 카테고리의 다른 글
[JS] 메뉴클릭하면 글이 나오도록 (0) | 2022.06.06 |
---|---|
[JS] 객체, 컬렉션 프레임워크 (0) | 2022.06.06 |
[JS] Math (0) | 2022.06.06 |
[JS] < ,> 버튼 과 목차버튼으로 이미지 넘기기 (0) | 2022.06.06 |
[JS] 달력만들기 (0) | 2022.06.05 |
Comments