File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -374,6 +374,23 @@ Heavily inspired by them as well:
374
374
var i;
375
375
```
376
376
377
+ - Avoid redundant variable names, use `Object`s instead.
378
+
379
+ ```javascript
380
+
381
+ // bad
382
+ var kaleidoscopeName = ' ..' ;
383
+ var kaleidoscopeLens = [];
384
+ var kaleidoscopeColors = [];
385
+
386
+ // good
387
+ var kaleidoscope {
388
+ name: ' ..' ,
389
+ lens: [],
390
+ colors: []
391
+ };
392
+ ```
393
+
377
394
- Assign variables at the top of their scope. This helps avoid issues with variable declaration and assignment hoisting related issues.
378
395
379
396
```javascript
@@ -438,7 +455,7 @@ Heavily inspired by them as well:
438
455
- core modules
439
456
- npm modules
440
457
- others
441
-
458
+
442
459
```javascript
443
460
// bad
444
461
var Car = require(' ./ models/ Car' );
You can’t perform that action at this time.
0 commit comments