Skip to content

Instantly share code, notes, and snippets.

@kurtroberts
Last active July 6, 2018 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kurtroberts/5f2d4e140ba55e7d38ce691dc13e1a41 to your computer and use it in GitHub Desktop.
Save kurtroberts/5f2d4e140ba55e7d38ce691dc13e1a41 to your computer and use it in GitHub Desktop.
Semicolon insertion
var x = 0
/***
While this comment seems like it might be the
beginning of a new statement, you should be careful what
your believe. ;) You should always check */+2/* or *+3* times
what the code is doing and what someone is explaining
in the comments. Sometimes crazy code likes to hide
inside really big comments.
Automatic semicolon insertion is great, until it isn't.
Also leaving off semicolons makes your code look unfinished.
I'll put up with your stupid */+2/* space tab indenting. But
please, stop trying to turn javascript into ruby.
***/
console.log(x)
// >>> 4
var x = 0;
/***
While this comment seems like it might be the
beginning of a new statement, you should be careful what
your believe. ;) You should always check */+2/* or *+3* times
what the code is doing and what someone is explaining
in the comments. Sometimes crazy code likes to hide
inside really big comments.
Automatic semicolon insertion is great, until it isn't.
Also leaving off semicolons makes your code look unfinished.
I'll put up with your stupid */+2/* space tab indenting. But
please, stop trying to turn javascript into ruby.
***/
console.log(x)
// >>> 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment