Fun fact about return statements. They get semicolon insertion if they're by themselves. That is:
return3;
is not the same as
return3;
While it doesn't usually come up, because who would write code like that?, it is a difference between javascript and say, c or c++ where both return styles would return 3.
Fun fact about return statements. They get semicolon insertion if they're by themselves. That is:
is not the same as
While it doesn't usually come up, because who would write code like that?, it is a difference between javascript and say, c or c++ where both return styles would return 3.
Agreed, but it's more likely to write code like this in React...
Which is why most editors will insert a parenthesis....
Parenthesis insertion to combat semicolon insertion! Amazing 😁