<script> function lol(type) { if(typeof type == "undefined") { alert("undefined"); } else if(typeof type == "object") { if(new String(type) == "null") ...
<script>
function lol(type)
{
if(typeof type == "undefined")
{
alert("undefined");
}
else if(typeof type == "object")
{
if(new String(type) == "null")
{
alert(null);
}
else
{
if(typeof type.valueOf() == "string")
{
alert("引用類型 String")
}
else if(typeof type.valueOf() == "number")
{
alert("引用類型 Number");
}
else if(typeof type.valueOf() == "boolean")
{
alert("引用類型 Boolean");
}
else
{
alert("數組")
}
}
}
else if(typeof type == "function")
{
alert("function")
}
else
{
alert(typeof type)
}
}
var c ;
var d = null;
//lol(c);
//lol(d);
//lol(1)
//lol(new Number(1))
//lol("s")
//lol(new String(""));
//lol(true);
//lol(new Boolean(true))
//lol([])
</script>