JSFiddle - React, Tailwind, and code Playground

by Paul Leech

JavaScript

String.prototype.toUnicode = function(){
    var result = "";
    for(var i = 0; i < this.length; i++){
        var partial = this[i].charCodeAt(0).toString(16);
        while(partial.length !== 4) partial = "0" + partial;
        result += "\\u" + partial;
    }
    return result;
};

prompt("™".toUnicode(), "™".toUnicode());