<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
/*
javascript中内置的对象 [javascript底层一切皆对象 ]
Object
Number
String
Boolean
Date
Array
Function
Error
*/
//toString() 返回字符串。
//valueOf() 返回某个字符串对象的原始值。
var arr = [1,2,3];
sop(arr.toString());//1,2,3
sop(arr.valueOf());//1,2,3
sop(typeof(arr.valueOf()));//object
var x = 1;
sop(x);//1
sop(typeof(x.valueOf()));//number
sop(x.toString());//1
sop(typeof(x.toString()));//string
function sop(data) {
document.write(data+"</br/>");
}
</script>
</head>
<body>
</body>
</html>