The tumblelog of
Scott Dowding.

I'm a software developer
in Edmonton, Alberta.

Questions? Email me

• Text Post

Comma-First JavaScript

At first I was a little skeptical about putting commas first but now that I’ve seen the code from Rhyan Dahl, I’m convinced. Just look at how easy it is to spot the error in the Comma-First example.

Standard Style

var a = "ape",
  b = "bat",
  d = "dog"
  e = "elf",
  f = "fly",
  i = "ibu";

Comma-First Style

var a = "ape"
  , b = "bat"
  , d = "dog"
  e = "elf"
  , f = "fly"
  , i = "ibu";

Notes

  1. dowding posted this

Comments

blog comments powered by Disqus

Stuff I Like

Following