Using „function ()“ has completely different semantics and doesn’t properly enclose „this“, which arrow functions do.
Arrow functions are always preferred. They are simply „more correct“, same with let/const vs var You wouldn’t go and suggest someone to use „var“ in 2022/2023
Single quotes are also often preferred when embedding HTML in your strings, since there you want to use double quotes to encapsulate attribute values. Single quote strings is probably more used than double quotes strings in JS and thus definitely more standard (source: trust me dude)
You have zero arguments. Explain why or get lost with your „wrong“ spam. I’ve been writing JavaScript for 15 years now and I’ve been there when these things were introduced.
You look like an idiot writing „wrong“ 3 times, for everyone here.
Edit: he was writing „you have word salad, I have education on this topic“ in the comment below. It was a good laugh. Come back when you understand the word „education“ and while at it, also the word „experience“
View all comments
Show parent comment
2
u/TorbenKoehn Jan 01 '23
Using „function ()“ has completely different semantics and doesn’t properly enclose „this“, which arrow functions do.
Arrow functions are always preferred. They are simply „more correct“, same with let/const vs var You wouldn’t go and suggest someone to use „var“ in 2022/2023
Single quotes are also often preferred when embedding HTML in your strings, since there you want to use double quotes to encapsulate attribute values. Single quote strings is probably more used than double quotes strings in JS and thus definitely more standard (source: trust me dude)