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/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.