Note that I've used != instead of !== in order to check for undefined. If you were going the strict approach you'd have used !== instead but because we're unaware of what will be coming in line. We're using a non-strict check here. I think this is a fairly simple solution in this case
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I'd have to see the rest of the code to decide whether or not this would be the best case but for now
Note that I've used
!=
instead of!==
in order to check for undefined. If you were going the strict approach you'd have used!==
instead but because we're unaware of what will be coming inline
. We're using a non-strict check here. I think this is a fairly simple solution in this case