【1】JS中的值类型与对象
以下四种为简单值类型:
console.log(typeof(x)); // undefined console.log(typeof(10)); // number console.log(typeof('abc')); // string console.log(typeof(true)); // boolean
函数、数组、对象、null 、new Number(10)都为对象;
console.log(typeof(function () { })); //function console.log(typeof([1, 'a', true])); //object console.log(typeof ({ a: 10, b: 20 })); //object console.log(typeof (null)); //object console.log(typeof (new Number(10))); //object
【2】创建JS函数的三种方式
点击查看三种创建函数的方式
【3】JS-Tips
【4】原型链图
【5】测试图
- 自定义函数、Function、Object的
__proto__与prototype
- 自定义函数的原型链
- Function函数的原型链