关于 Extjs 4.X中 Ext.Function源码中的一些问题, 关于javascript基础知识的

Ext.Function中定义了如下一个叫做flexSetter的函数,其作用看看就明白
问题在于 其中做a===null判断的地方为什么不用a==null呢?

源码如下:

Ext.Function = {

/**
 * A very commonly used method throughout the framework. It acts as a wrapper around another method
 * which originally accepts 2 arguments for `name` and `value`.
 * The wrapped function then allows "flexible" value setting of either:
 *
 * - `name` and `value` as 2 arguments
 * - one single object argument with multiple key - value pairs
 *
 * For example:
 *
 *     var setValue = Ext.Function.flexSetter(function(name, value) {
 *         this[name] = value;
 *     });
 *
 *     // Afterwards
 *     // Setting a single name - value
 *     setValue('name1', 'value1');
 *
 *     // Settings multiple name - value pairs
 *     setValue({
 *         name1: 'value1',
 *         name2: 'value2',
 *         name3: 'value3'
 *     });
 *
 * @param {Function} setter
 * @returns {Function} flexSetter
 */
flexSetter: function(fn) {
    return function(a, b) {
        var k, i;

        if (a === null) {
            return this;
        }

        if (typeof a !== 'string') {
            for (k in a) {
                if (a.hasOwnProperty(k)) {
                    fn.call(this, k, a[k]);
                }
            }

            if (Ext.enumerables) {
                for (i = Ext.enumerables.length; i--;) {
                    k = Ext.enumerables[i];
                    if (a.hasOwnProperty(k)) {
                        fn.call(this, k, a[k]);
                    }
                }
            }
        } else {
            fn.call(this, a, b);
        }

        return this;
    };
},

哈哈 结贴
作者的思路是过滤null不过滤undefined 也就是说 作者允许这样

var myObj={
setValue:Ext.Function.flextSetter(function(name,value){
    this[name]=value;
})

};

myObj.setValue(null,"none");

而不允许这样

var myObj={
setValue:Ext.Function.flextSetter(function(name,value){
    this[name]=value;
})

};

myObj.setValue();

第一种容错 第二种不容错,容错处理点到为止,不过头