|
@@ -0,0 +1,40 @@
|
|
|
+// console.log(typeof '1');
|
|
|
+// console.log(typeof 12);
|
|
|
+// console.log(typeof false);
|
|
|
+var a;
|
|
|
+// console.log(typeof a);
|
|
|
+// console.log(typeof null); //object
|
|
|
+let b = {
|
|
|
+ name:"图图"
|
|
|
+}
|
|
|
+let c = [1,2,3]
|
|
|
+function fn1() {
|
|
|
+ return 12;
|
|
|
+}
|
|
|
+
|
|
|
+// console.log(typeof b);
|
|
|
+// console.log(typeof c);
|
|
|
+// console.log(typeof fn1);
|
|
|
+
|
|
|
+// console.log(b instanceof Object);
|
|
|
+// console.log(c instanceof Object);
|
|
|
+// console.log(fn1 instanceof Function);
|
|
|
+
|
|
|
+
|
|
|
+// console.log(Object.prototype.toString.call(1))
|
|
|
+// console.log(Object.prototype.toString.call('12'))
|
|
|
+// console.log(Object.prototype.toString.call(true))
|
|
|
+// console.log(Object.prototype.toString.call(a))
|
|
|
+// console.log(Object.prototype.toString.call(b))
|
|
|
+// console.log(Object.prototype.toString.call(c))
|
|
|
+// console.log(Object.prototype.toString.call(fn1))
|
|
|
+// console.log(Object.prototype.toString.call(null))
|
|
|
+
|
|
|
+console.log(false.constructor === String)
|
|
|
+console.log('12'.constructor === String)
|
|
|
+console.log((1).constructor === Number)
|
|
|
+console.log(b.constructor === Object)
|
|
|
+console.log(c.constructor === Array)
|
|
|
+console.log(fn1.constructor === Function)
|
|
|
+// console.log(a.constructor === undefined)
|
|
|
+// console.log(null.constructor === Null)
|