用来看数据类型的方法。
- DOCTYPE html>
-
-
-
-
Document -
- let l1 = true;
- document.write(typeof(l1) + "
"); -
- let l2 = null;
- document.write(typeof(l2) + "
"); -
- let l3;
- document.write(typeof(l3) + "
"); -
- let l4 = 10;
- document.write(typeof(l4) + "
"); -
- let l5 = "hello";
- document.write(typeof(l5) + "
"); -
- let l6 = 100n;
- document.write(typeof(l6) + "
"); -
l2的类型是null,应该算是个bug,不过问题不大
