Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Finding Emoji combinations programmatically, is reversing the Spread Operator possible?

There are a number of emojis that are not just stand-alone Unicode characters. They are actually a combination of two or more other emojis. e.g.

console.log([...'👨‍👨‍👧‍👧']); // 👨 + 👨+ 👧+ 👧

console.log([...'🧑🏿‍❤️‍💋‍🧑🏾']); // 🧑 + ❤ + 💋 + 🧑

console.log([...'🧑‍🚀']); // 🧑 + 🚀

What I would like to know, is given the constituent parts, is it possible to go the other way and combine emojis so that you can generate the combined symbol? Really the opposite of what the Spread Operator is doing here.

e.g. Is it possible to generate 👨‍👨‍👧‍👧 from 👨,👨,👧,👧

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I’ve tried I few different ideas but nothing seems to work – mainly just getting SyntaxErrors.

>Solution :

First link in the google https://www.bram.us/2016/08/27/fun-with-javascript-and-emoji/

["👨", "‍", "👨", "‍", "👧", "‍", "👧"].reduce((prev, next) => prev + next)

It is really easy to achieve

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading