jeudi 23 avril 2020

javascript = vs == with if and else statements

I have a variable var stIm = ''; and I am trying to put it into an if and else statement.

When I have

if (stIm = ''){}else{} it only runs the if part

if (stIm == ''){}else{} it only runs the else part

Does anyone knows how to fix this? Does === work?

Aucun commentaire:

Enregistrer un commentaire