Adapter
call
Given a key and a set of arguments, call them when given a context. Primarily useful in composition.
Use a closure to call a stored key with stored arguments.
const call = (key, ...args) => context => context[key](...args);
+ }
30 seconds of code Curated collection of useful JavaScript snippets that you can understand in 30 seconds or less.
\ No newline at end of file
diff --git a/snippets/yesNo.md b/snippets/yesNo.md
index 3783e6fde..5d191cb94 100644
--- a/snippets/yesNo.md
+++ b/snippets/yesNo.md
@@ -11,8 +11,8 @@ const yesNo = (val, def = false) =>
```
```js
-yesNo('Y') // true
-yesNo('yes') // true
-yesNo('No') // false
-yesNo('Foo', true) // true
+yesNo('Y'); // true
+yesNo('yes'); // true
+yesNo('No'); // false
+yesNo('Foo', true); // true
```