Skip to content

Commit 81aeefd

Browse files
authored
javascript
1 parent c8d7354 commit 81aeefd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

_til/codestyle/js.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
title: JavaScript
3+
category: codestyle
4+
---
5+
6+
__JS__ (Use something like ESLint)
7+
```js
8+
//Function Signatures:
9+
function foo(arg1, arg2) {
10+
11+
//if/else
12+
if x == y {
13+
return x;
14+
}
15+
return y;
16+
17+
//No non bracketed blocks
18+
//wrong:
19+
if x == 1
20+
return true;
21+
//correct:
22+
if x == 1 {
23+
return true;
24+
}
25+
```

0 commit comments

Comments
 (0)