摘要: • 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. 阅读全文
posted @ 2014-04-12 15:14 LambdaTea 阅读(210) 评论(0) 推荐(0) 编辑
摘要: '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++是一样的,要有对象。 阅读全文
posted @ 2014-04-12 13:48 LambdaTea 阅读(501) 评论(0) 推荐(0) 编辑