I agree with most of these, except the semicolon one. It's perfectly fine if you don't use them.
I think what this article is missing is a section about consistency. Double quotes vs single quotes? Semicolons or not? It doesn't matter as long as you're consistent with it. Also, you could perhaps suggest using ESLint.
In the eyes of a beginner, what do they expect this code to do? If they're not used to writing with semicolons they might expect it to return the object, but instead they get undefined.
I do 100% agree about consistency. Whichever way you go, be consistent.
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 agree with most of these, except the semicolon one. It's perfectly fine if you don't use them.
I think what this article is missing is a section about consistency. Double quotes vs single quotes? Semicolons or not? It doesn't matter as long as you're consistent with it. Also, you could perhaps suggest using ESLint.
Thanks for the suggestion. I'll include that too..
Have a good day😋
Agreed!
I'd argue that beginners should use semicolons to understand the implications of writing without them.
For the most part you shouldn't have any issues, but there are some gotchas that will trip up beginners.
For example,
In the eyes of a beginner, what do they expect this code to do? If they're not used to writing with semicolons they might expect it to return the object, but instead they get
undefined
.I do 100% agree about consistency. Whichever way you go, be consistent.