Browse Source

Add more principles.

pull/2/head
Oleksii Trekhleb 5 years ago
parent
commit
8fedae194b
  1. 23
      README.md

23
README.md

@ -101,6 +101,29 @@ let ingredients = ['tomato', 'onion', 'mushrooms'];
let dressings = ['ketchup', 'mayonnaise']; let dressings = ['ketchup', 'mayonnaise'];
``` ```
### 💩 Put as much code as possible into one line
_Good 👍🏻_
```javascript
document.location.search.replace(/(^\?)/,'').split('&').reduce(function(o,n){n=n.split('=');o[n[0]]=n[1];return o},{})
```
_Bad 👎🏻_
```javascript
document.location.search
.replace(/(^\?)/, '')
.split('&')
.reduce((searchParams, keyValuePair) => {
keyValuePair = keyValuePair.split('=');
searchParams[keyValuePair[0]] = keyValuePair[1];
return searchParams;
},
{}
)
```
### 💩 Do not lock your dependencies ### 💩 Do not lock your dependencies
Update your dependencies on each new installation in uncontrolled way. Why stick to the past, let's use the cutting edge libraries versions. Update your dependencies on each new installation in uncontrolled way. Why stick to the past, let's use the cutting edge libraries versions.

Loading…
Cancel
Save