dimanche 30 mai 2021

Something is wrong with my if and else statement

Here is my code:

var points = 10

if(points == 10) {

points + 200;

}

else if (points === 100) {

points + 10;


}

console.log(points)

What happens is that it logs 10, when what i would like to happen is that it logs 210. Any idea on what i have done wrong? I got some feedback on it on an earlier question, but it still does not seem to work.

Aucun commentaire:

Enregistrer un commentaire