Embrace async
Before
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| let af = () => promise;
let bf = () => promise;
let cf = () => {
return af().then(() => {
return bf().then(result => {
let t = result;
return ...;
})
});
}
let df = () => {
cf().then().catch();
}
|
Now we need babel
to compile this syntax
NPM
- add scripts to
package.json
Style guide
ESlint
, JSLint
and so on.
Handle errors and logging important messages
Some syntax
like:
Process management
Use Content-Security-Policy
in web application
reduce XSS (Cross-Site scripting) risks on modern browsers, https://content-security-policy.com/.