| <script> | |
| var a=12; | |
| alert(typeof a); //number | |
| a=‘abc‘; | |
| //alert(typeof a); //string | |
| a=true; | |
| //alert(typeof a); //boolean 布尔 | |
| /*window.onload=function () | |
| { | |
| a=document.getElementById(‘div1‘); | |
| alert(typeof a); //object | |
| };*/ | |
| a=function () | |
| { | |
| alert(‘abc‘); | |
| }; | |
| //alert(typeof a); //function | |
| var b; | |
| alert(typeof b); //undefined | |
| /* | |
| undefined 1.你真的就没定义 2.虽然定义了,但是没给值 | |
| */ | |
| </script> |
前端javascript基础总结(1)js的构成以及数据类型
原文:http://www.cnblogs.com/wj88/p/6372160.html