Skip to content

Semicolons #51

Description

@stefnotch
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions