The Family Emoji
I was reading Impatient JS and came up on a surprising part:
but when my friend Jordan tried it:
What⦠why?! Is the book wrong?
There are 2 βfamilyβ emojisβ¦
If you already know the answer, the book is clearβ¦ When you search for the βfamily emojiβ and end up on a page like this, youβll see whatβs going on:
Thereβs one codepoint thatβs already the family emoji. But the same result can be obtained by combining a series of codepoints:
These are the same hexadecimal values as the screenshot above. Everything is right with the world :-)
The U+200d character is the ZERO WIDTH JOINER, abbreviated to ZWJ. The joining section from the emoji Wikipedia page gives context that will feel very familiar (pun intended).
There are all kinds of families
The example above is just one of the many emoji families available:
Additional Resources
I had heard of these things but hadnβt fully grasped them until I played with them myself. While I was trying to figure this out, I found a bunch of good resources:
- Wes Bos has a tweet with cool examples
- unicode.orgβs full list of emojis
- Good intro to code points vs grapheme clusters
- More emoji fun
- Cry a little: Dark Corners of Unicode
- Awesome Unicode, which Iβm just starting to read