• Q&A
  • 회원가입
  • 로그인

[Conversion] JS - ["ten","twenty"] 타입변환 - (숫자: NaN , 문자열: "ten,twenty" , 참거짓: true)

303  

["ten","twenty"] 타입변환

 

<p id="demo"></p>


<script>

var x = ["ten","twenty"];

document.getElementById("demo").innerHTML =

"Number : " + Number(x) + "<br>" +

"String : " + String(x) + "<br>" +

"Boolean: " + Boolean(x);

</script>

 

결과보기

결과값:

Number : NaN

String : ten,twenty

Boolean: true

 


찾아주셔서 감사합니다. Since 2012