Skip to content

Commit

Permalink
adds lisp example to cheatsheet
Browse files Browse the repository at this point in the history
  • Loading branch information
ptolemybarnes committed Jul 20, 2020
1 parent d0c60fd commit 720da2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cheatsheets/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,20 @@ const fooBar = (a, b, c) => {
}
```

### Arrow function w/out braces
#### Arrow function w/out braces
```js
// no braces, return implicit
const fooBar = (a, b, c) => a + b + c

// though usually written on one line, it can be spread across multiple lines.
const fooBar = (a, b, c) =>
a + b + c

// lispy one-liner
const fooBar = (a, b, c) => (a + b + c)
```

### Arrow function returning object
#### Arrow function returning object

This is really a variation on the arrow function one-liner. But it's so common that it's worth listing here.

Expand Down

0 comments on commit 720da2c

Please sign in to comment.