1 <!DOCTYPE html> 2 <html> 3 <head lang="en"> 4 <meta charset="UTF-8"> 5 <title></title> 6 </head> 7 <body> 8 <script> 9 10 //函数也是一种数据类型。但是,归根结底,他还是属于object。 11 12 var str = "abc"; 13 var num = 111; 14 var boo = true; 15 var aaa; 16 var bbb = null;//对象类型 17 var arr = [];//对象类型 18 19 function fn(){ 20 alert(1); 21 // return 111; 22 } 23 24 console.log(typeof str); 25 console.log(typeof num); 26 console.log(typeof boo); 27 console.log(typeof aaa); 28 console.log(typeof bbb); 29 console.log(typeof arr); 30 console.log(typeof fn); 31 console.log(typeof fn()); 32 33 </script> 34 </body> 35 </html>