为什么console.log(typeof eleInner); 得到的值是string,
但是console.log(eleInner instanceof String);得到的值却是false<!DOCTYPE html><html><head>
<title></title></head><body>
<p>HelloWorld</p>
<script type="text/javascript">
var eleP = document.querySelector("p"); var eleInner = eleP.innerHTML; console.log(typeof eleInner); //string
console.log(eleInner instanceof String); //false
</script></body></html>
1 回答
- 1 回答
- 0 关注
- 903 浏览
添加回答
举报
0/150
提交
取消