- Notifications
You must be signed in to change notification settings - Fork0
JavaScript Style Guide
comparaonline/javascript-style-guide
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A mostly reasonable approach to JavaScript. Based on AirBnB Style Guide and adapted to ComparaOnline practices.
- Types
- Objects
- Arrays
- Strings
- Functions
- Properties
- Variables
- Hoisting
- Comparison Operators & Equality
- Blocks
- Comments
- Whitespace
- Commas
- Semicolons
- Type Casting & Coercion
- Naming Conventions
- Accessors
- Constructors
- Classes
- Events
- Modules
- jQuery
- ECMAScript 5 Compatibility
- Testing
- Performance
- Resources
- In the Wild
- Translation
- The JavaScript Style Guide Guide
- Contributors
- License
Primitives: When you access a primitive type you work directly on its value.
stringnumberbooleannullundefined
varfoo=1;varbar=foo;bar=9;console.log(foo,bar);// => 1, 9
Complex: When you access a complex type you work on a reference to its value.
objectarrayfunction
varfoo=[1,2];varbar=foo;bar[0]=9;console.log(foo[0],bar[0]);// => 9, 9
Use the literal syntax for object creation.
// badvaritem=newObject();// goodvaritem={};
Don't usereserved words as keys. It won't work in IE8.More info.
// badvarsuperman={default:{clark:'kent'},private:true};// goodvarsuperman={defaults:{clark:'kent'},hidden:true};
Use readable synonyms in place of reserved words.
// badvarsuperman={class:'alien'};// badvarsuperman={klass:'alien'};// goodvarsuperman={type:'alien'};
Use the literal syntax for array creation.
// badvaritems=newArray();// goodvaritems=[];
Use Array#push instead of direct assignment to add items to an array.
varsomeStack=[];// badsomeStack[someStack.length]='abracadabra';// goodsomeStack.push('abracadabra');
When you need to copy an array use Array#slice.jsPerf
varlen=items.length;varitemsCopy=[];vari;// badfor(i=0;i<len;i++){itemsCopy[i]=items[i];}// gooditemsCopy=items.slice();
To convert an array-like object to an array, use Array#slice.
functiontrigger(){varargs=Array.prototype.slice.call(arguments); ...}
Use single quotes
''for strings.// badvarname="Bob Parr";// goodvarname='Bob Parr';// badvarfullName="Bob "+this.lastName;// goodvarfullName='Bob '+this.lastName;
Strings longer than 100 characters should be written across multiple lines using string concatenation.
Note: If overused, long strings with concatenation could impact performance.jsPerf &Discussion.
// badvarerrorMessage='This is a super long error that was thrown because of Batman. When you stop to think about how Batman had anything to do with this, you would get nowhere fast.';// badvarerrorMessage='This is a super long error that was thrown because \of Batman. When you stop to think about how Batman had anything to do \with this, you would get nowhere \fast.';// goodvarerrorMessage='This is a super long error that was thrown because '+'of Batman. When you stop to think about how Batman had anything to do '+'with this, you would get nowhere fast.';
When programmatically building up a string, use Array#join instead of string concatenation. Mostly for IE:jsPerf.
varitems;varmessages;varlength;vari;messages=[{state:'success',message:'This one worked.'},{state:'success',message:'This one worked as well.'},{state:'error',message:'This one did not work.'}];length=messages.length;// badfunctioninbox(messages){items='<ul>';for(i=0;i<length;i++){items+='<li>'+messages[i].message+'</li>';}returnitems+'</ul>';}// goodfunctioninbox(messages){items=[];for(i=0;i<length;i++){// use direct assignment in this case because we're micro-optimizing.items[i]='<li>'+messages[i].message+'</li>';}return'<ul>'+items.join('')+'</ul>';}
Function expressions:
// anonymous function expressionvaranonymous=function(){returntrue;};// named function expressionvarnamed=functionnamed(){returntrue;};// immediately-invoked function expression (IIFE)(function(){console.log('Welcome to the Internet. Please follow me.');})();
Never declare a function in a non-function block (if, while, etc). Assign the function to a variable instead. Browsers will allow you to do it, but they all interpret it differently, which is bad news bears.
Note: ECMA-262 defines a
blockas a list of statements. A function declaration is not a statement.Read ECMA-262's note on this issue.// badif(currentUser){functiontest(){console.log('Nope.');}}// goodvartest;if(currentUser){test=functiontest(){console.log('Yup.');};}
Never name a parameter
arguments. This will take precedence over theargumentsobject that is given to every function scope.// badfunctionnope(name,options,arguments){// ...stuff...}// goodfunctionyup(name,options,args){// ...stuff...}
Use dot notation when accessing properties.
varluke={jedi:true,age:28};// badvarisJedi=luke['jedi'];// goodvarisJedi=luke.jedi;
Use subscript notation
[]when accessing properties with a variable.varluke={jedi:true,age:28};functiongetProp(prop){returnluke[prop];}varisJedi=getProp('jedi');
Always use
varto declare variables. Not doing so will result in global variables. We want to avoid polluting the global namespace. Captain Planet warned us of that.// badsuperPower=newSuperPower();// goodvarsuperPower=newSuperPower();
Use one
vardeclaration per variable.It's easier to add new variable declarations this way, and you never haveto worry about swapping out a;for a,or introducing punctuation-onlydiffs.// badvaritems=getItems(),goSportsTeam=true,dragonball='z';// bad// (compare to above, and try to spot the mistake)varitems=getItems(),goSportsTeam=true;dragonball='z';// goodvaritems=getItems();vargoSportsTeam=true;vardragonball='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.
// badvari,len,dragonball,items=getItems(),goSportsTeam=true;// badvari;varitems=getItems();vardragonball;vargoSportsTeam=true;varlen;// goodvaritems=getItems();vargoSportsTeam=true;vardragonball;varlength;vari;
Assign variables at the top of their scope. This helps avoid issues with variable declaration and assignment hoisting related issues.
// badfunction(){test();console.log('doing stuff..');//..other stuff..varname=getName();if(name==='test'){returnfalse;}returnname;}// goodfunction(){varname=getName();test();console.log('doing stuff..');//..other stuff..if(name==='test'){returnfalse;}returnname;}// bad - unnecessary function callfunction(){varname=getName();if(!arguments.length){returnfalse;}this.setFirstName(name);returntrue;}// goodfunction(){varname;if(!arguments.length){returnfalse;}name=getName();this.setFirstName(name);returntrue;}
Variable declarations get hoisted to the top of their scope, but their assignment does not.
// we know this wouldn't work (assuming there// is no notDefined global variable)functionexample(){console.log(notDefined);// => throws a ReferenceError}// creating a variable declaration after you// reference the variable will work due to// variable hoisting. Note: the assignment// value of `true` is not hoisted.functionexample(){console.log(declaredButNotAssigned);// => undefinedvardeclaredButNotAssigned=true;}// The interpreter is hoisting the variable// declaration to the top of the scope,// which means our example could be rewritten as:functionexample(){vardeclaredButNotAssigned;console.log(declaredButNotAssigned);// => undefineddeclaredButNotAssigned=true;}
Anonymous function expressions hoist their variable name, but not the function assignment.
functionexample(){console.log(anonymous);// => undefinedanonymous();// => TypeError anonymous is not a functionvaranonymous=function(){console.log('anonymous function expression');};}
Named function expressions hoist the variable name, not the function name or the function body.
functionexample(){console.log(named);// => undefinednamed();// => TypeError named is not a functionsuperPower();// => ReferenceError superPower is not definedvarnamed=functionsuperPower(){console.log('Flying');};}// the same is true when the function name// is the same as the variable name.functionexample(){console.log(named);// => undefinednamed();// => TypeError named is not a functionvarnamed=functionnamed(){console.log('named');}}
Function declarations hoist their name and the function body.
functionexample(){superPower();// => FlyingfunctionsuperPower(){console.log('Flying');}}
For more information refer toJavaScript Scoping & Hoisting byBen Cherry.
Use
===and!==over==and!=.Conditional statements such as the
ifstatement evaluate their expression using coercion with theToBooleanabstract method and always follow these simple rules:- Objects evaluate totrue
- Undefined evaluates tofalse
- Null evaluates tofalse
- Booleans evaluate tothe value of the boolean
- Numbers evaluate tofalse if+0, -0, or NaN, otherwisetrue
- Strings evaluate tofalse if an empty string
'', otherwisetrue
if([0]){// true// An array is an object, objects evaluate to true}
Use shortcuts.
// badif(name!==''){// ...stuff...}// goodif(name){// ...stuff...}// badif(collection.length>0){// ...stuff...}// goodif(collection.length){// ...stuff...}
For more information seeTruth Equality and JavaScript by Angus Croll.
Use braces with all multi-line blocks.
// badif(test)returnfalse;// goodif(test)returnfalse;// goodif(test){returnfalse;}// badfunction(){returnfalse;}// goodfunction(){returnfalse;}
If you're using multi-line blocks with
ifandelse, putelseon the same line as yourifblock's closing brace.// badif(test){thing1();thing2();}else{thing3();}// goodif(test){thing1();thing2();}else{thing3();}
Use
/** ... */for multi-line comments. Include a description, specify types and values for all parameters and return values.// bad// make() returns a new element// based on the passed in tag name////@param {String} tag//@return {Element} elementfunctionmake(tag){// ...stuff...returnelement;}// good/** * make() returns a new element * based on the passed in tag name * *@param {String} tag *@return {Element} element */functionmake(tag){// ...stuff...returnelement;}
Use
//for single line comments. Place single line comments on a newline above the subject of the comment. Put an empty line before the comment.// badvaractive=true;// is current tab// good// is current tabvaractive=true;// badfunctiongetType(){console.log('fetching type...');// set the default type to 'no type'vartype=this._type||'no type';returntype;}// goodfunctiongetType(){console.log('fetching type...');// set the default type to 'no type'vartype=this._type||'no type';returntype;}
Prefixing your comments with
FIXMEorTODOhelps other developers quickly understand if you're pointing out a problem that needs to be revisited, or if you're suggesting a solution to the problem that needs to be implemented. These are different than regular comments because they are actionable. The actions areFIXME -- need to figure this outorTODO -- need to implement.Use
// FIXME:to annotate problems.functionCalculator(){// FIXME: shouldn't use a global heretotal=0;returnthis;}
Use
// TODO:to annotate solutions to problems.functionCalculator(){// TODO: total should be configurable by an options paramthis.total=0;returnthis;}
Use soft tabs set to 2 spaces.
// badfunction(){∙∙∙∙varname;}// badfunction(){∙varname;}// goodfunction(){∙∙varname;}
Place 1 space before the leading brace.
// badfunctiontest(){console.log('test');}// goodfunctiontest(){console.log('test');}// baddog.set('attr',{age:'1 year',breed:'Bernese Mountain Dog'});// gooddog.set('attr',{age:'1 year',breed:'Bernese Mountain Dog'});
Place 1 space before the opening parenthesis in control statements (
if,whileetc.). Place no space before the argument list in function calls and declarations.// badif(isJedi){fight();}// goodif(isJedi){fight();}// badfunctionfight(){console.log('Swooosh!');}// goodfunctionfight(){console.log('Swooosh!');}
Set off operators with spaces.
// badvarx=y+5;// goodvarx=y+5;
End files with a single newline character.
// bad(function(global){// ...stuff...})(this);
// bad(function(global){// ...stuff...})(this);↵↵
// good(function(global){// ...stuff...})(this);↵
Use indentation when making long method chains. Use a leading dot, whichemphasizes that the line is a method call, not a new statement.
// bad$('#items').find('.selected').highlight().end().find('.open').updateCount();// bad$('#items').find('.selected').highlight().end().find('.open').updateCount();// good$('#items').find('.selected').highlight().end().find('.open').updateCount();// badvarleds=stage.selectAll('.led').data(data).enter().append('svg:svg').classed('led',true).attr('width',(radius+margin)*2).append('svg:g').attr('transform','translate('+(radius+margin)+','+(radius+margin)+')').call(tron.led);// goodvarleds=stage.selectAll('.led').data(data).enter().append('svg:svg').classed('led',true).attr('width',(radius+margin)*2).append('svg:g').attr('transform','translate('+(radius+margin)+','+(radius+margin)+')').call(tron.led);
Leave a blank line after blocks and before the next statement
// badif(foo){returnbar;}returnbaz;// goodif(foo){returnbar;}returnbaz;// badvarobj={foo:function(){},bar:function(){}};returnobj;// goodvarobj={foo:function(){},bar:function(){}};returnobj;
Leading commas:Nope.
// badvarstory=[once,upon,aTime];// goodvarstory=[once,upon,aTime];// badvarhero={firstName:'Bob',lastName:'Parr',heroName:'Mr. Incredible',superPower:'strength'};// goodvarhero={firstName:'Bob',lastName:'Parr',heroName:'Mr. Incredible',superPower:'strength'};
Additional trailing comma:Nope. This can cause problems with IE6/7 and IE9 if it's in quirksmode. Also, in some implementations of ES3 would add length to an array if it had an additional trailing comma. This was clarified in ES5 (source):
Edition 5 clarifies the fact that a trailing comma at the end of an ArrayInitialiser does not add to the length of the array. This is not a semantic change from Edition 3 but some implementations may have previously misinterpreted this.
```javascript// badvar hero = { firstName: 'Kevin', lastName: 'Flynn',};var heroes = [ 'Batman', 'Superman',];// goodvar hero = { firstName: 'Kevin', lastName: 'Flynn'};var heroes = [ 'Batman', 'Superman'];```Yup.
// bad(function(){varname='Skywalker'returnname})()// good(function(){varname='Skywalker';returnname;})();// good (guards against the function becoming an argument when two files with IIFEs are concatenated);(function(){varname='Skywalker';returnname;})();
Perform type coercion at the beginning of the statement.
Strings:
// => this.reviewScore = 9;// badvartotalScore=this.reviewScore+'';// goodvartotalScore=''+this.reviewScore;// badvartotalScore=''+this.reviewScore+' total score';// goodvartotalScore=this.reviewScore+' total score';
Use
parseIntfor Numbers and always with a radix for type casting.varinputValue='4';// badvarval=newNumber(inputValue);// badvarval=+inputValue;// badvarval=inputValue>>0;// badvarval=parseInt(inputValue);// goodvarval=Number(inputValue);// goodvarval=parseInt(inputValue,10);
If for whatever reason you are doing something wild and
parseIntis your bottleneck and need to use Bitshift forperformance reasons, leave a comment explaining why and what you're doing.// good/** * parseInt was the reason my code was slow. * Bitshifting the String to coerce it to a * Number made it a lot faster. */varval=inputValue>>0;
Note: Be careful when using bitshift operations. Numbers are represented as64-bit values, but Bitshift operations always return a 32-bit integer (source). Bitshift can lead to unexpected behavior for integer values larger than 32 bits.Discussion. Largest signed 32-bit Int is 2,147,483,647:
2147483647>>0//=> 21474836472147483648>>0//=> -21474836482147483649>>0//=> -2147483647
Booleans:
varage=0;// badvarhasAge=newBoolean(age);// goodvarhasAge=Boolean(age);// goodvarhasAge=!!age;
Avoid single letter names. Be descriptive with your naming.
// badfunctionq(){// ...stuff...}// goodfunctionquery(){// ..stuff..}
Use camelCase when naming objects, functions, and instances.
// badvarOBJEcttsssss={};varthis_is_my_object={};varo={};functionc(){}// goodvarthisIsMyObject={};functionthisIsMyFunction(){}
Use PascalCase when naming constructors or classes.
// badfunctionuser(options){this.name=options.name;}varbad=newuser({name:'nope'});// goodfunctionUser(options){this.name=options.name;}vargood=newUser({name:'yup'});
Use a leading underscore
_when naming private properties.// badthis.__firstName__='Panda';this.firstName_='Panda';// goodthis._firstName='Panda';
When saving a reference to
thisuse_this.// badfunction(){varself=this;returnfunction(){console.log(self);};}// badfunction(){varthat=this;returnfunction(){console.log(that);};}// goodfunction(){var_this=this;returnfunction(){console.log(_this);};}
Name your functions. This is helpful for stack traces.
// badvarlog=function(msg){console.log(msg);};// goodvarlog=functionlog(msg){console.log(msg);};
Note: IE8 and below exhibit some quirks with named function expressions. Seehttp://kangax.github.io/nfe/ for more info.
Accessor functions for properties are not required.
If you do make accessor functions use getVal() and setVal('hello').
// baddragon.age();// gooddragon.getAge();// baddragon.age(25);// gooddragon.setAge(25);
If the property is a boolean, use isVal() or hasVal().
// badif(!dragon.age()){returnfalse;}// goodif(!dragon.hasAge()){returnfalse;}
It's okay to create get() and set() functions, but be consistent.
functionJedi(options){options||(options={});varlightsaber=options.lightsaber||'blue';this.set('lightsaber',lightsaber);}Jedi.prototype.set=function(key,val){this[key]=val;};Jedi.prototype.get=function(key){returnthis[key];};
Assign methods to the prototype object, instead of overwriting the prototype with a new object. Overwriting the prototype makes inheritance impossible: by resetting the prototype you'll overwrite the base!
functionJedi(){console.log('new jedi');}// badJedi.prototype={fight:functionfight(){console.log('fighting');},block:functionblock(){console.log('blocking');}};// goodJedi.prototype.fight=functionfight(){console.log('fighting');};Jedi.prototype.block=functionblock(){console.log('blocking');};
Methods can return
thisto help with method chaining.// badJedi.prototype.jump=function(){this.jumping=true;returntrue;};Jedi.prototype.setHeight=function(height){this.height=height;};varluke=newJedi();luke.jump();// => trueluke.setHeight(20);// => undefined// goodJedi.prototype.jump=function(){this.jumping=true;returnthis;};Jedi.prototype.setHeight=function(height){this.height=height;returnthis;};varluke=newJedi();luke.jump().setHeight(20);
It's okay to write a custom toString() method, just make sure it works successfully and causes no side effects.
functionJedi(options){options||(options={});this.name=options.name||'no name';}Jedi.prototype.getName=functiongetName(){returnthis.name;};Jedi.prototype.toString=functiontoString(){return'Jedi - '+this.getName();};
Simple classes should be defined using the anonymous function syntax:
varClassName=(function(){// body here ...});
Variables should be defined in the lowest scope possible:
// badvarClassName=(function(){varvarTotal=$('#some-id').data('total');varsquareTotal=functionsquareTotal(){returnvarTotal*varTotal;};});// goodvarClassName=(function(){varsquareTotal=functionsquareTotal(){varvarTotal=$('#some-id').data('total');returnvarTotal*varTotal;};});// badvarClassName=(function(){vardecrTotal=functiondecrTotal(){varvarTotal=$('#some-id').data('total');returnvarTotal-1;};varincrTotal=functionincrTotal(){varvarTotal=$('#some-id').data('total');returnvarTotal+1;};});// goodvarClassName=(function(){varvarTotal=$('#some-id').data('total');vardecrTotal=functiondecrTotal(){returnvarTotal-1;};varincrTotal=functionincrTotal(){returnvarTotal+1;};});
When attaching data payloads to events (whether DOM events or something more proprietary like Backbone events), pass a hash instead of a raw value. This allows a subsequent contributor to add more data to the event payload without finding and updating every handler for the event. For example, instead of:
// bad$(this).trigger('listingUpdated',listing.id);...$(this).on('listingUpdated',function(e,listingId){// do something with listingId});
prefer:
// good$(this).trigger('listingUpdated',{listingId :listing.id});...$(this).on('listingUpdated',function(e,data){// do something with data.listingId});
The module should start with a
!. This ensures that if a malformed module forgets to include a final semicolon there aren't errors in production when the scripts get concatenated.ExplanationThe file should be named with camelCase, live in a folder with the same name, and match the name of the single export.
Add a method called
noConflict()that sets the exported module to the previous version and returns this one.Always declare
'use strict';at the top of the module.// fancyInput/fancyInput.js!function(global){'use strict';varpreviousFancyInput=global.FancyInput;functionFancyInput(options){this.options=options||{};}FancyInput.noConflict=functionnoConflict(){global.FancyInput=previousFancyInput;returnFancyInput;};global.FancyInput=FancyInput;}(this);
Prefix jQuery object variables with a
$.// badvarsidebar=$('.sidebar');// goodvar$sidebar=$('.sidebar');
Cache jQuery lookups.
// badfunctionsetSidebar(){$('.sidebar').hide();// ...stuff...$('.sidebar').css({'background-color':'pink'});}// goodfunctionsetSidebar(){var$sidebar=$('.sidebar');$sidebar.hide();// ...stuff...$sidebar.css({'background-color':'pink'});}
For DOM queries use Cascading
$('.sidebar ul')or parent > child$('.sidebar > ul').jsPerfUse
findwith scoped jQuery object queries.// bad$('ul','.sidebar').hide();// bad$('.sidebar').find('ul').hide();// good$('.sidebar ul').hide();// good$('.sidebar > ul').hide();// good$sidebar.find('ul').hide();
- Refer toKangax's ES5compatibility table.
Yup.
function(){returntrue;}
- On Layout & Web Performance
- String vs Array Concat
- Try/Catch Cost In a Loop
- Bang Function
- jQuery Find vs Context, Selector
- innerHTML vs textContent for script text
- Long String Concatenation
- Loading...
Read This
Tools
- Code Style Linters
Other Style Guides
- Google JavaScript Style Guide
- jQuery Core Style Guidelines
- Principles of Writing Consistent, Idiomatic JavaScript
- JavaScript Standard Style
Other Styles
- Naming this in nested functions - Christian Johansen
- Conditional Callbacks - Ross Allen
- Popular JavaScript Coding Conventions on Github - JeongHoon Byun
- Multiple var statements in JavaScript, not superfluous - Ben Alman
Further Reading
- Understanding JavaScript Closures - Angus Croll
- Basic JavaScript for the impatient programmer - Dr. Axel Rauschmayer
- You Might Not Need jQuery - Zack Bloom & Adam Schwartz
- ES6 Features - Luke Hoban
- Frontend Guidelines - Benjamin De Cock
Books
- #"http://www.amazon.com/JavaScript-Patterns-Stoyan-Stefanov/dp/0596806752" rel="nofollow">JavaScript Patterns - Stoyan Stefanov
- Pro JavaScript Design Patterns - Ross Harmes and Dustin Diaz
- High Performance Web Sites: Essential Knowledge for Front-End Engineers - Steve Souders
- Maintainable JavaScript - Nicholas C. Zakas
- JavaScript Web Applications - Alex MacCaw
- Pro JavaScript Techniques - John Resig
- Smashing Node.js: JavaScript Everywhere - Guillermo Rauch
- Secrets of the JavaScript Ninja - John Resig and Bear Bibeault
- Human JavaScript - Henrik Joreteg
- Superhero.js - Kim Joar Bekkelund, Mads Mobæk, & Olav Bjorkoy
- JSBooks - Julien Bouquillon
- Third Party JavaScript - Ben Vinegar and Anton Kovalyov
- Effective #"http://eloquentjavascript.net" rel="nofollow">Eloquent JavaScript - Marijn Haverbeke
- You Don't Know JS - Kyle Simpson
Blogs
- DailyJS
- JavaScript Weekly
- JavaScript, JavaScript...
- Bocoup Weblog
- Adequately Good
- NCZOnline
- Perfection Kills
- Ben Alman
- Dmitry Baranovskiy
- Dustin Diaz
- nettuts
Podcasts
This is a list of organizations that are using this style guide. Send us a pull request or open an issue and we'll add you to the list.
- Aan Zee:AanZee/javascript
- Adult Swim:adult-swim/javascript
- Airbnb:airbnb/javascript
- Apartmint:apartmint/javascript
- Avalara:avalara/javascript
- Billabong:billabong/javascript
- Compass Learning:compasslearning/javascript-style-guide
- DailyMotion:dailymotion/javascript
- Digitpaintdigitpaint/javascript
- Evernote:evernote/javascript-style-guide
- ExactTarget:ExactTarget/javascript
- Flexberry:Flexberry/javascript-style-guide
- Gawker Media:gawkermedia/javascript
- General Electric:GeneralElectric/javascript
- GoodData:gooddata/gdc-js-style
- Grooveshark:grooveshark/javascript
- How About We:howaboutwe/javascript
- InfoJobs:InfoJobs/JavaScript-Style-Guide
- Intent Media:intentmedia/javascript
- Jam3:Jam3/Javascript-Code-Conventions
- JSSolutions:JSSolutions/javascript
- Kinetica Solutions:kinetica/javascript
- Mighty Spring:mightyspring/javascript
- MinnPost:MinnPost/javascript
- ModCloth:modcloth/javascript
- Money Advice Service:moneyadviceservice/javascript
- Muber:muber/javascript
- National Geographic:natgeo/javascript
- National Park Service:nationalparkservice/javascript
- Nimbl3:nimbl3/javascript
- Nordic Venture Family:CodeDistillery/javascript
- Orion Health:orionhealth/javascript
- Peerby:Peerby/javascript
- Razorfish:razorfish/javascript-style-guide
- reddit:reddit/styleguide/javascript
- REI:reidev/js-style-guide
- Ripple:ripple/javascript-style-guide
- SeekingAlpha:seekingalpha/javascript-style-guide
- Shutterfly:shutterfly/javascript
- StudentSphere:studentsphere/javascript
- Target:target/javascript
- TheLadders:TheLadders/javascript
- T4R Technology:T4R-Technology/javascript
- VoxFeed:VoxFeed/javascript-style-guide
- Weggo:Weggo/javascript
- Zillow:zillow/javascript
- ZocDoc:ZocDoc/javascript
This style guide is also available in other languages:
Brazilian Portuguese:armoucar/javascript-style-guide
Bulgarian:borislavvv/javascript
Catalan:fpmweb/javascript-style-guide
Chinese(Traditional):jigsawye/javascript
Chinese(Simplified):sivan/javascript-style-guide
French:nmussy/javascript-style-guide
German:timofurrer/javascript-style-guide
Italian:sinkswim/javascript-style-guide
Japanese:mitsuruog/javacript-style-guide
Korean:tipjs/javascript-style-guide
Polish:mjurczyk/javascript
Russian:uprock/javascript
Spanish:paolocarrasco/javascript-style-guide
Thai:lvarayut/javascript-style-guide
(The MIT License)
Copyright (c) 2014 Airbnb
Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the'Software'), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:
The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
About
JavaScript Style Guide
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.