console.log(Object.prototype.toString.call(null))
//[object Null]
console.log(Object.prototype.toString.call(123))
//[object Number]
console.log(Object.prototype.toString.call('123'))
//[object String]
console.log(Object.prototype.toString.call(undefined))
//[object Undefined]
console.log(Object.prototype.toString.call(new Date()))
//[object Date]
console.log(Object.prototype.toString.call(function(){}))
//[object Function]
console.log(Object.prototype.toString.call([]))
//[object Array]
console.log(Object.prototype.toString.call(true))
//[object Boolean]
当 typeof 变数,变数本身有宣告但并未赋值,会出现 undefined
var a ;
console.log(typeof a)
//undefined
当变数未宣告且未赋值,会出现 error
console.log(a)
ReferenceError: a is not defined
at Object.<anonymous> (/Users/rock/.bitnami/stackman/machines/xampp/volumes/root/htdocs/rock/week16-js/type.js:21:13)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
<<: 寻觅 webpack - 29 - 解构 webpack - 自己动手写 webpack
昨天已经能让TableViewCell显示餐厅资料了 但....好像有点单调,让我们来加点餐厅的图片...
今天的任务: 部署至GitHub Page(後续部署在vercel) 搜寻框弹出效果 Demo Li...
第二十八天了,讲到练习题第七题 不知不觉已经快结束了,因为篇幅的关系,所以可能无法说完全部的练习题 ...
时间永远是人生的一大问题,但在`Ruby的世界中,却不是什麽问题。只要我们熟悉一些时间上的技巧,基本...
RealmSwift 昨天分享了 Realm 的基本操作,今天要来分享观察 Realm 资料库的工具...