This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* some helpers to keep the examples clean | |
*/ | |
const makeUnicorn = (animal) => animal === '🐴' ? '🦄' : '💩' | |
const isUnicorn = (animal) => animal === '🦄' | |
const isNoUnicorn = (animal) => animal !== '🦄' | |
const countUnicorns = (count, animal) => count + (animal === '🦄' ? 1 : 0) | |
const copyAnimals = (animals) => [...animals] |