From 661cfe1e59d0afdc2f385e5696c7dd857ebdef0e Mon Sep 17 00:00:00 2001 From: Paul Tannenbaum Date: Sat, 25 Jan 2014 23:57:31 -0800 Subject: [PATCH 1/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38fdcb1474..aa8a5f8ad6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Airbnb JavaScript Style Guide() { +# Liftopia JavaScript Style Guide() { *A mostly reasonable approach to JavaScript* From f11e097c601f651822464a28aaffc37c23dc1473 Mon Sep 17 00:00:00 2001 From: Paul Tannenbaum Date: Wed, 5 Feb 2014 15:28:08 -0800 Subject: [PATCH 2/2] Updated how we declare variables --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index aa8a5f8ad6..3f82849653 100644 --- a/README.md +++ b/README.md @@ -368,18 +368,19 @@ var superPower = new SuperPower(); ``` - - Use one `var` declaration for multiple variables and declare each variable on a newline. + - Use `var` declaration for each new variable. This prevents us to have to worry about formatting and is more explicit. ```javascript // bad - var items = getItems(); - var goSportsTeam = true; - var dragonball = 'z'; - - // good var items = getItems(), goSportsTeam = true, dragonball = 'z'; + + + // good + var items = getItems(); + var goSportsTeam = true; + var dragonball = 'z'; ``` - Declare unassigned variables last. This is helpful when later on you might need to assign a variable depending on one of the previous assigned variables.