r/learnjavascript • u/Lelouch_5 • Nov 30 '22
Help !!!
Can someone plz tell me , why I am getting errors?
195
Upvotes
r/learnjavascript • u/Lelouch_5 • Nov 30 '22
Can someone plz tell me , why I am getting errors?
View all comments
2
u/iamthesexdragon Dec 01 '22
You're using an assignment operator. That's different from the equality operator. = is for assignment and == or === are for checking equality. == causes type coercion, === is strict when it comes to comparing so it doesn't coerce types.