Interpretation is not an object literal (pure object). Methods are created object literal {}, new Object () Create

// interpretation whether it is their own property 
function isHasPro (obj, Pro) {
     return obj.hasOwnProperty (Pro)? To true : false ;   
} 

// interpretation is not an object literal (pure object). Methods are created object literal {}, new Object () Create 
function isPlainObject (obj) {
     // if the value is null, or the object is not, return to false; 
    IF (obj == null || typeof ! Obj = 'Object' ) {
         return  to false ; 
    } 
    IF (isHasPro (obj.constructor.prototype, "isPrototypeOf" )) {
         return  to true ; 
    } 
    return  to false ; 
}

 

Guess you like

Origin www.cnblogs.com/littleboyck/p/11227598.html