r/javascript • • Apr 01 '18

Google publishes a JavaScript style guide. Here are some key lessons.

https://medium.freecodecamp.org/google-publishes-a-javascript-style-guide-here-are-some-key-lessons-1810b8ad050b
714 Upvotes

317 comments sorted by

View all comments

Show parent comments

3

u/Voidsheep Apr 02 '18

Pretending ASI doesn't exist is also dangerous, it's not like you can disable it.

function shouldHitTheBrakes() {
  return
    isSmeoneOnTheWay ||
    isTurnAhead ||
    isAboveSpeedLimit
}

2

u/hyperhopper Apr 02 '18

Extremely true!

Though I've never seen somebody use a return without something on that line. Plus any linter will yell at you for unreachable code in that case.