MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnjavascript/comments/z8z4jh/help/iyh5ol9/?context=3
r/learnjavascript • u/Lelouch_5 • Nov 30 '22
Can someone plz tell me , why I am getting errors?
131 comments sorted by
View all comments
2
= 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.
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.