Created
March 24, 2015 04:36
-
-
Save jreyes33/c26a8b6781aa8fa9e3b5 to your computer and use it in GitHub Desktop.
Better emoji support in ES6
This file contains 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
let isAnimal = (emojo) => | |
'๐'.codePointAt(0) <= emojo.codePointAt(0) && | |
emojo.codePointAt(0) <= '๐ผ'.codePointAt(0); | |
let emoji = ['๐ถ', '๐ป', '๐ธ', '๐ป', '๐ฉ', '๐ณ']; | |
let animals = [for (e of emoji) if (isAnimal(e)) e]; | |
console.log(animals); | |
// => ["๐ถ","๐ธ","๐ป","๐ณ"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment