Input:
Hello worldπ©βπ¦°π©βπ©βπ¦βπ¦
Desired Output:
π©βπ©βπ¦βπ¦π©βπ¦°dlrow olleH
I tried several approaches but none gave me correct answer.
This failed miserablly:
const text="Hello worldπ©βπ¦°π©βπ©βπ¦βπ¦";
const reversed = text.split('').reverse().join('');
console.log(reversed);
This kinda works but it breaks π©βπ©βπ¦βπ¦
into 4 different emojis:
const text="Hello worldπ©βπ¦°π©βπ©βπ¦βπ¦";
const reversed = [...text].reverse().join('');
console.log(reversed);
I also tried every answer in this question but none of them works.
Is there a way to get the desired output?