2016年12月13日 星期二

(js)各種行別的特色

null '=>'
constructor.toString()=
Object.getPrototypeOf()= undefined
type= object
toString.call()= [object Null]
----------------------------------
undefined '=>'
constructor.toString()=
Object.getPrototypeOf()= undefined
type= undefined
toString.call()= [object Undefined]
----------------------------------
5 =>
constructor.toString()=
function String() { [native code] }
Object.getPrototypeOf()= [String: '']
type= string
toString.call()= [object String]
toString()= 5
----------------------------------
5 '=>'
constructor.toString()=
function Number() { [native code] }
Object.getPrototypeOf()= [Number: 0]
type= number
toString.call()= [object Number]
toString()= 5
----------------------------------
{ age: 15 } '=>'
constructor.toString()=
function Object() { [native code] }
Object.getPrototypeOf()= {}
type= object
toString.call()= [object Object]
toString()= [object Object]
----------------------------------
[ 2, 3 ] '=>'
constructor.toString()=
function Array() { [native code] }
Object.getPrototypeOf()= []
type= object
toString.call()= [object Array]
toString()= 2,3
----------------------------------
SelfDefineObj {} '=>'
constructor.toString()=
function SelfDefineObj() {}
Object.getPrototypeOf()= SelfDefineObj {}
type= object
toString.call()= [object Object]
toString()= [object Object]
----------------------------------
true '=>'
constructor.toString()=
function Boolean() { [native code] }
Object.getPrototypeOf()= [Boolean: false]
type= boolean
toString.call()= [object Boolean]
toString()= true
----------------------------------
[Function] '=>'
constructor.toString()=
function Function() { [native code] }
Object.getPrototypeOf()= function () {}
type= function
toString.call()= [object Function]
toString()= function () {

    }
----------------------------------
Map {} '=>'
constructor.toString()=
function Map() { [native code] }
Object.getPrototypeOf()= Map {}
type= object
toString.call()= [object Map]
toString()= [object Map]
----------------------------------
Tue Dec 20 2016 17:15:57 GMT+0800 (????????) '=>'
constructor.toString()=
function Date() { [native code] }
Object.getPrototypeOf()= Invalid Date
type= object
toString.call()= [object Date]
toString()= Tue Dec 20 2016 17:15:57 GMT+0800 (????????)
----------------------------------
/\d/ '=>'
constructor.toString()=
function RegExp() { [native code] }
Object.getPrototypeOf()= /(?:)/
type= object
toString.call()= [object RegExp]
toString()= /\d/
----------------------------------