Reputation
Next privilege 125 Rep.
Vote down
Badges
1
Impact
0 people reached

  • 0 posts edited
  • 0 helpful flags
  • 0 votes cast
Sep
24
awarded  Autobiographer
May
13
comment Why the recent shift to removing/omitting semicolons from Javascript?
Clarifying point: the return example is actually an exception to the normal JS behavior which is to attempt to pull lines together when a semi-colon is omitted. return, break, and continue all exhibit this exceptional behavior in which a trailing newline is always interpreted as an end of statement. (Source is Flanagan's "JavaScript: The Definitive Guide" pp25-26). Personally, I strive for the idea of "code of least surprise." Leaving semi-colons out tends to result in more surprises than anything (I generally also keep my curly braces even for simple statements).