Skip to content

Commit 437e33a

Browse files
committed
Merge branch 'master' of github.com:airbnb/javascript
* 'master' of github.com:airbnb/javascript: capitalizing types that are constructors Switched modules to bang-style.
2 parents ab5910a + d5a05ef commit 437e33a

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737

3838
- **Primitives**: When you access a primitive type you work directly on its value
3939

40-
+ `string`
41-
+ `number`
42-
+ `boolean`
40+
+ `String`
41+
+ `Number`
42+
+ `Boolean`
4343
+ `null`
4444
+ `undefined`
4545

@@ -53,9 +53,9 @@
5353
```
5454
- **Complex**: When you access a complex type you work on a reference to its value
5555

56-
+ `object`
57-
+ `array`
58-
+ `function`
56+
+ `Object`
57+
+ `Array`
58+
+ `Function`
5959

6060
```javascript
6161
var foo = [1, 2],
@@ -1087,14 +1087,15 @@
10871087
10881088
## <a name='modules'>Modules</a>
10891089
1090+
- 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.
10901091
- The file should be named with camelCase, live in a folder with the same name, and match the name of the single export.
10911092
- Add a method called noConflict() that sets the exported module to the previous version.
10921093
- Always declare `'use strict;'` at the top of the module.
10931094

10941095
```javascript
10951096
// fancyInput/fancyInput.js
10961097
1097-
(function(global) {
1098+
!function(global) {
10981099
'use strict';
10991100
11001101
var previousFancyInput = global.FancyInput;
@@ -1108,7 +1109,7 @@
11081109
};
11091110
11101111
global.FancyInput = FancyInput;
1111-
})(this);
1112+
}(this);
11121113
```
11131114

11141115
**[[⬆]](#TOC)**

0 commit comments

Comments
 (0)