[ ].has(对象)
假设.indexOf()被执行  
Object.defineProperty( Array.prototype,'has',
{
    value:function(o, flag){
    if (flag === undefined) {
        return this.indexOf(o) !== -1;
    } else {   // only for raw js object
        for(var v in this) {
            if( JSON.stringify(this[v]) === JSON.stringify(o)) return true;
        }
        return false;                       
    },
    // writable:false,
    // enumerable:false
})
!!!不要制作,Array.prototype.has=function(){...因为您将在每个数组中添加一个可枚举元素并且 js 已损坏。
//use like          
[22 ,'a', {prop:'x'}].has(12) // false
["a","b"].has("a") //  true
[1,{a:1}].has({a:1},1) // true
[1,{a:1}].has({a:1}) // false
使用第二个参数(标志)强制按值而不是引用进行比较  
比较原始对象 
[o1].has(o2,true) // true if every level value is same