javaScript 数据类型
<!DOCTYPE html> <html> <head> <title>javaScript 数据类型</title> </head> <body> <p id = "typeof"></p> <script> document.getElementById("typeof").innerHTML = "typeof \"test string\"->" +typeof "test string" + "<br>" + "typeof 1234567->"+typeof 1234567 + "<br>" + "typeof NaN->"+typeof NaN + "<br>" + "typeof true->"+typeof true + "<br>" + "typeof [1,2,3,4]->"+typeof [1,2,3,4] + "<br>" + "typeof {name:'jack ma', sex:'女',age:50}->"+typeof {name:'jack ma', sex:'女',age:50} + "<br>" + "typeof new Date()->"+typeof new Date() + "<br>" + "typeof function () {}->"+typeof function () {} + "<br>" + "typeof abc->"+typeof abc + "<br>" + "typeof null->"+typeof null; var Animal = function() { type:"cat"; name:"KT" }; var animal = new Animal(); console.log((animal instanceof Animal)) </script> </body> </html>
标签:function,javaScript,数据类型,typeof,Animal,new From: https://www.cnblogs.com/dwdw/p/16728196.html