Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Semicolons #51

Open
stefnotch opened this issue Jan 13, 2017 · 0 comments
Open

Semicolons #51

stefnotch opened this issue Jan 13, 2017 · 0 comments

Comments

@stefnotch
Copy link

stefnotch commented Jan 13, 2017

function yellIt(string) {
  string = string.toUpperCase()
  return makeMoreExciting(string)
}

That code has no semicolons. Well, it usually works, but not always:

a = 1 + 2
(3 + 4).toString()

Here is another (beautiful) example of that:

var a=3,b=3
[a,b]=[a*a,b*b]
console.log([a,b])

Another example:

x = 1 + 2
-1..toString()

Sources:
http://mislav.net/2010/05/semicolons/
http://codegolf.stackexchange.com/a/48438/33160

I would suggest simply adding semicolons at the end of every statement. (Or, you could add a semicolon when they are needed. Though, explaining that would be more work and most likely would cause more screw ups)

P.S. http://www.randomkittengenerator.com/cats/rotator.php

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant