-

-Airbnb JavaScript Style Guide() {

- -

A mostly reasonable approach to JavaScript

- -

Downloads -Downloads -Gitter

- -

Other Style Guides

- - - -

-Table of Contents

- -
    -
  1. Types
  2. -
  3. References
  4. -
  5. Objects
  6. -
  7. Arrays
  8. -
  9. Destructuring
  10. -
  11. Strings
  12. -
  13. Functions
  14. -
  15. Arrow Functions
  16. -
  17. Classes & Constructors
  18. -
  19. Modules
  20. -
  21. Iterators and Generators
  22. -
  23. Properties
  24. -
  25. Variables
  26. -
  27. Hoisting
  28. -
  29. Comparison Operators & Equality
  30. -
  31. Blocks
  32. -
  33. Comments
  34. -
  35. Whitespace
  36. -
  37. Commas
  38. -
  39. Semicolons
  40. -
  41. Type Casting & Coercion
  42. -
  43. Naming Conventions
  44. -
  45. Accessors
  46. -
  47. Events
  48. -
  49. jQuery
  50. -
  51. ECMAScript 5 Compatibility
  52. -
  53. ECMAScript 6 Styles
  54. -
  55. Testing
  56. -
  57. Performance
  58. -
  59. Resources
  60. -
  61. In the Wild
  62. -
  63. Translation
  64. -
  65. The JavaScript Style Guide Guide
  66. -
  67. Chat With Us About JavaScript
  68. -
  69. Contributors
  70. -
  71. License
  72. -
- -

-Types

- -

- - - -

⬆ back to top

- -

-References

- -

- - - -

⬆ back to top

- -

-Objects

- -

- - - -

⬆ back to top

- -

-Arrays

- -

- - - -

⬆ back to top

- -

-Destructuring

- -

- - - -

⬆ back to top

- -

-Strings

- -

- - - -

⬆ back to top

- -

-Functions

- -

- - - -

⬆ back to top

- -

-Arrow Functions

- -

- - - -

⬆ back to top

- -

-Classes & Constructors

- -

- - - -

⬆ back to top

- -

-Modules

- -

- - - -

⬆ back to top

- -

-Iterators and Generators

- -

- - - -

⬆ back to top

- -

-Properties

- -

- - - -

⬆ back to top

- -

-Variables

- -

- - - -

⬆ back to top

- -

-Hoisting

- -

- - - -

⬆ back to top

- -

-Comparison Operators & Equality

- -

- - - -

⬆ back to top

- -

-Blocks

- -

- - - -

⬆ back to top

- -

-Comments

- -

- - - -

⬆ back to top

- -

-Whitespace

- -

- - - -

⬆ back to top

- -

-Commas

- -

- - - -

⬆ back to top

- -

-Semicolons

- -

- - - -

⬆ back to top

- -

-Type Casting & Coercion

- -

- - - -

⬆ back to top

- -

-Naming Conventions

- -

- - - -

⬆ back to top

- -

-Accessors

- -

- - - -

⬆ back to top

- -

-Events

- -

- - - -

-jQuery

- -

- - - -

⬆ back to top

- -

-ECMAScript 5 Compatibility

- -

- - - -

⬆ back to top

- -

-ECMAScript 6 Styles

- -

- - - -
    -
  1. Arrow Functions
  2. -
  3. Classes
  4. -
  5. Object Shorthand
  6. -
  7. Object Concise
  8. -
  9. Object Computed Properties
  10. -
  11. Template Strings
  12. -
  13. Destructuring
  14. -
  15. Default Parameters
  16. -
  17. Rest
  18. -
  19. Array Spreads
  20. -
  21. Let and Const
  22. -
  23. Iterators and Generators
  24. -
  25. Modules
  26. -
- -

⬆ back to top

- -

-Testing

- -

- - - -

⬆ back to top

- -

-Performance

- - - -

⬆ back to top

- -

-Resources

- -

Learning ES6

- - - -

Read This

- - - -

Tools

- - - -

Other Style Guides

- - - -

Other Styles

- - - -

Further Reading

- - - -

Books

- - - -

Blogs

- - - -

Podcasts

- - - -

⬆ back to top

- -

-In the Wild

- -

This is a list of organizations that are using this style guide. Send us a pull request and we'll add you to the list.

- - - -

⬆ back to top

- -

-Translation

- -

This style guide is also available in other languages:

- - - -

-The JavaScript Style Guide Guide

- - - -

-Chat With Us About JavaScript

- - - -

-Contributors

- - - -

-License

- -

(The MIT License)

- -

Copyright (c) 2014-2016 Airbnb

- -

Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions:

- -

The above copyright notice and this permission notice shall be -included 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 OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

- -

⬆ back to top

- -

-Amendments

- -

We encourage you to fork this guide and change the rules to fit your team's style guide. Below, you may list some amendments to the style guide. This allows you to periodically update your style guide without having to deal with merge conflicts.

- -

-};

- - - -