null 타입변환
<p id="demo"></p> <script> var x = null; document.getElementById("demo").innerHTML = "Number : " + Number(x) + "<br>" + "String : " + String(x) + "<br>" + "Boolean: " + Boolean(x); </script> 결과보기
<p id="demo"></p>
<script>
var x = null;
document.getElementById("demo").innerHTML =
"Number : " + Number(x) + "<br>" +
"String : " + String(x) + "<br>" +
"Boolean: " + Boolean(x);
</script>
결과보기
결과값:
Number : 0
String : null
Boolean: false