<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title></title> </head> <body> <script> //函数也是一种数据类型。但是,归根结底,他还是属于object。 var str = "abc"; var num = 111; var boo = true; var aaa; var bbb = null;//对象类型 var arr = [];//对象类型 function fn(){ alert(1); // return 111; } console.log(typeof str); console.log(typeof num); console.log(typeof boo); console.log(typeof aaa); console.log(typeof bbb); console.log(typeof arr); console.log(typeof fn); console.log(typeof fn()); </script> </body> </html>
时间: 2024-10-05 05:02:05