SOURCE

// null && undefined
console.log(null == 0) // false
console.log(NaN == 0) // NAN永不相等哦
console.log(undefined == 0) // false
console.log(null == undefined) // true!!!
console.log(null === undefined) // false
console.log(typeof null) // object
console.log(typeof undefined) // undefined
console.log('1_______________')
// 自身相等性
console.log(null == null)
console.log(null === null)
console.log(undefined == undefined)
console.log(undefined === undefined)
console.log(NaN == NaN) // NAN永不相等哦 false
console.log({} == {}) // 引用类型
console.log([] == []) // 引用类型
console.log('2_______________')
// arr 类型 
console.log(typeof []) // object
console.log([] instanceof Object) // true
console.log([] instanceof Array) // true
console.log(Object.prototype.toString.call([])) // [object Array]
console.log('3_______________')
// 关于类型转换
console.log(typeof 1.2) // float -> Number
console.log(typeof ('12' - 1)) // 减号操作为Number特有 -> 11
console.log(typeof ('12' + 1), '12' + 1) // // 加号首先识别为string + -> 121
console.log(typeof (1 + '12'), 1 + '12') // // 加号首先识别为string + -> 121
console.log(Object.is(NaN, NaN)) // 两个值是否为同一个值
console.log(Object.is(+0, -0)) //两个值是否为同一个值
console.log(Object.is(NaN, 0)) //两个值是否为同一个值
console.log(+0 == -0) // true
console.log(+0 === -0) // true
console.log('离谱', [] + 0) //0
console.log('离谱', [] + '0') // 0
console.log('离谱', {} + 0) // [object Object] 0 // 转string
console.log('离谱', {} + '0') // [object Object] 0 // 转string
console.log('离谱', undefined + '0') // 字符串处理
console.log('离谱', undefined + 0) // NaN 不合规计算
console.log('离谱', null + '1') // 字符串处理
console.log('离谱', null + 1) // 转换为0
console.log('4_______________')
// function
function a() { }
console.log(typeof a) // function
console.log(typeof new Function()) // function
console.log(a instanceof Object) // true
console.log(a instanceof Function) // true
console.log(a + 1) // 转string
console.log(a + '1') // 转string
console.log('5_______________')
// more
let b = function () { }
let c = new b()
console.log(b instanceof Function, c instanceof Function)
console.log(b instanceof Object, c instanceof Object)
console.log('6_______________')
// false
console.log(null == false, null == true) //  false,false
console.log(undefined == false, undefined == true) //  false,false
console.log('' == false) // true
console.log('0' == false) // true
console.log(0 == false) // true
console.log('3', 3 == true) // true
console.log({} == false, {} == true)  //  false,false
console.log([] == false) // true
console.log([] == 0) // true
console.log(NaN == false, NaN == true) //  false,false
.box {
    margin: 10px 10px
}
console 命令行工具 X clear

                    
>
console