Skip to content

Semicolons #51

@stefnotch

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

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