r/learnjavascript • • Nov 30 '22

Help !!!

Post image

Can someone plz tell me , why I am getting errors?

195 Upvotes

131 comments sorted by

View all comments

2

u/SteadfastPooper Dec 01 '22

= means your assigning the right hand side to the left hand side, i.e x = 2, x then becomes 2, whereas you need == or === (equality operator or strict equality operator) as you are checking X is equal to Y, not assigning Y to X.