vendredi 3 avril 2015

in vs hasOwnProperty vs ifs [on hold]

Hello What's the differences between :



yo = { mamma : 'is fat' };

if(yo.hasOwnProperty('mamma')){ }

if('mama' in yo){ }

if(yo['mamma']){ }

if(yo.mamma){ }


?


Aucun commentaire:

Enregistrer un commentaire