diff --git a/README.md b/README.md index 120ebb5a..832b24b1 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ *A mostly reasonable approach to JavaScript* -## Table of Contents +## Table of Contents 1. [Types](#types) 1. [Objects](#objects) @@ -34,7 +34,7 @@ 1. [Contributors](#contributors) 1. [License](#license) -## Types +## Types - **Primitives**: When you access a primitive type you work directly on its value @@ -69,7 +69,7 @@ **[[⬆]](#TOC)** -## Objects +## Objects - Use the literal syntax for object creation. @@ -100,7 +100,7 @@ ``` **[[⬆]](#TOC)** -## Arrays +## Arrays - Use the literal syntax for array creation @@ -161,7 +161,7 @@ **[[⬆]](#TOC)** -## Strings +## Strings - Use single quotes `''` for strings @@ -249,7 +249,7 @@ **[[⬆]](#TOC)** -## Functions +## Functions - Function expressions: @@ -306,7 +306,7 @@ -## Properties +## Properties - Use dot notation when accessing properties. @@ -341,7 +341,7 @@ **[[⬆]](#TOC)** -## Variables +## Variables - Always use `var` to declare variables. Not doing so will result in global variables. We want to avoid polluting the global namespace. Captain Planet warned us of that. @@ -449,7 +449,7 @@ **[[⬆]](#TOC)** -## Hoisting +## Hoisting - Variable declarations get hoisted to the top of their scope, their assignment does not. @@ -540,7 +540,7 @@ -## Conditional Expressions & Equality +## Conditional Expressions & Equality - Use `===` and `!==` over `==` and `!=`. - Conditional expressions are evaluated using coercion with the `ToBoolean` method and always follow these simple rules: @@ -588,7 +588,7 @@ **[[⬆]](#TOC)** -## Blocks +## Blocks - Use braces with all multi-line blocks. @@ -617,7 +617,7 @@ **[[⬆]](#TOC)** -## Comments +## Comments - Use `/** ... */` for multiline comments. Include a description, specify types and values for all parameters and return values. @@ -684,7 +684,7 @@ **[[⬆]](#TOC)** -## Whitespace +## Whitespace - Use soft tabs set to 2 spaces @@ -779,7 +779,7 @@ .call(tron.led); ``` -## Leading Commas +## Leading Commas - **Nope.** @@ -814,7 +814,7 @@ **[[⬆]](#TOC)** -## Semicolons +## Semicolons - **Yup.** @@ -841,7 +841,7 @@ **[[⬆]](#TOC)** -## Type Casting & Coercion +## Type Casting & Coercion - Perform type coercion at the beginning of the statement. - Strings: @@ -913,7 +913,7 @@ **[[⬆]](#TOC)** -## Naming Conventions +## Naming Conventions - Avoid single letter names. Be descriptive with your naming. @@ -1027,7 +1027,7 @@ **[[⬆]](#TOC)** -## Accessors +## Accessors - Accessor functions for properties are not required - If you do make accessor functions use getVal() and setVal('hello') @@ -1081,7 +1081,7 @@ **[[⬆]](#TOC)** -## Constructors +## Constructors - 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! @@ -1166,7 +1166,7 @@ **[[⬆]](#TOC)** -## Modules +## Modules - 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. - The file should be named with camelCase, live in a folder with the same name, and match the name of the single export. @@ -1196,7 +1196,7 @@ **[[⬆]](#TOC)** -## jQuery +## jQuery - Prefix jQuery object variables with a `$`. @@ -1261,14 +1261,14 @@ **[[⬆]](#TOC)** -## ECMAScript 5 Compatability +## ECMAScript 5 Compatability - Refer to [Kangax](https://twitter.com/kangax/)'s ES5 [compatibility table](http://kangax.github.com/es5-compat-table/) **[[⬆]](#TOC)** -## Testing +## Testing - **Yup.** @@ -1281,7 +1281,7 @@ **[[⬆]](#TOC)** -## Performance +## Performance - [String vs Array Concat](http://jsperf.com/string-vs-array-concat/2) - [Try/Catch Cost In a Loop](http://jsperf.com/try-catch-in-loop-cost) @@ -1293,7 +1293,7 @@ **[[⬆]](#TOC)** -## Resources +## Resources **Read This** @@ -1337,7 +1337,7 @@ **[[⬆]](#TOC)** -## In the Wild +## In the Wild 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. @@ -1347,16 +1347,16 @@ - **MinnPost**: [MinnPost/javascript](//github.com/MinnPost/javascript) - **Shutterfly**: [shutterfly/javascript](//github.com/shutterfly/javascript) -## The JavaScript Style Guide Guide +## The JavaScript Style Guide Guide - [Reference](//github.com/airbnb/javascript/wiki/The-JavaScript-Style-Guide-Guide) -## Contributors +## Contributors - [View Contributors](https://github.com/airbnb/javascript/graphs/contributors) -## License +## License (The MIT License)