function Fn() { var n = 10; this.m = n; var f = new Fn() // console.log(f instanceof Fn);//=>TRUE // console.log(f instanceof Array);//=>FALSE // console.log(f instanceof Object);//=>TRUE (万物皆对象:所有的对象,包含创建的实例都是Object的实例)
// console.log('m' in f);//=>TRUE // console.log('n' in f);//=>FALSE // console.log('toString' in f);//=>TRUE toString是它的公有属性
console.log(f.hasOwnProperty('m'));//=>TRUE // console.log(f.hasOwnProperty('n'));//=>FALSE 连这个属性都没有 // console.log(f.hasOwnProperty('toString'));//=>FALSE 虽然有这个属性但是不是私有的属性