mardi 25 août 2015

My comparison seems to be wrong

I'm trying to compare to functions. Each function have this: return returnArr.toString(); as a return, which are strings both of them.

if ( moveRight() == paintFood(235,10,"blue") ){
alert("Food!")
};

But it's not the same like this one:

if ("A" == "A"){
alert("Right comparison");
};

Why ???

Aucun commentaire:

Enregistrer un commentaire