From 720da2c39d277483cdb4c765f258f17c849b242a Mon Sep 17 00:00:00 2001 From: Ptolemy Barnes Date: Mon, 20 Jul 2020 11:02:44 +0200 Subject: [PATCH] adds lisp example to cheatsheet --- cheatsheets/javascript.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cheatsheets/javascript.md b/cheatsheets/javascript.md index 32b38b1..6b4e687 100644 --- a/cheatsheets/javascript.md +++ b/cheatsheets/javascript.md @@ -36,7 +36,7 @@ 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 @@ -44,9 +44,12 @@ 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.