DEV Community

Daniel Zotti
Daniel Zotti

Posted on • Edited on

#LearnedToday: Compound Emoji πŸ‘¨β€πŸ’»

Today is Emoji day, and I'd like to share something I learned about emojis that blew my mind! 🀯

Did you know that the πŸ‘¨β€πŸ’» "Man Technologist" emoji (aka developer) is created by combining other two emojis? πŸ‘¨ "Man" & πŸ’» "Laptop"

These types of emojis are called Compound emoji, and they exist thanks to a non-printable character called the "Zero Width Joiner" (\u200D), which is used to merge two or more emojis.

So the final equation is: πŸ‘¨ + ZWJ + πŸ’» = πŸ‘¨β€πŸ’»

You can see it clearly if you use the spread operator on the emoji string!

const compoundEmoji = 'πŸ‘¨β€πŸ’»';
const explodedEmoji = [...compoundEmoji];

console.log(explodedEmoji);

// ['πŸ‘¨', '‍', 'πŸ’»']
// The second element is the unicode character ZWJ
Enter fullscreen mode Exit fullscreen mode

I've created a stackblitz demo where you can play with emojis in JavaScript

Check out also these useful links:

Top comments (0)