lundi 19 août 2019

JavaScript typeof to check if obj is undefined

Is that any reason to check undefined like this:

if(typeof obj === 'undefined') {
    return rObj
}

instead of:

if(obj === undefined){
    return rObj
}

?

Aucun commentaire:

Enregistrer un commentaire