摘要:
• undefined means “no value” (neither primitive nor object). Uninitialized variables,missing parameters, and missing properties have that nonvalue. And functionsimplicitly return it if nothing has been explicitly returned.• null means “no object.” It is used as a nonvalue where an object is expecte. 阅读全文
摘要:
'use strict';var jane = { name: 'Jane', describe: function() { return 'Person named ' + this.name; }};var func = jane.describe;func(); //TypeError: Cannot read property 'name' of undefinedvar func2 = jane.describe.bind(jane); JS里的bind概念基本和C++是一样的,要有对象。 阅读全文