terribleMia’s avatarterribleMia’s Twitter Archive—№ 8,747

      1. Is there a good way to automate "unicode-range" values from a string in JS? Or should I keep copy/pasting these strings into a web form that spits out unicode, and then pasting the results back into my code? 😬
    1. …in reply to @TerribleMia
      I got it! I think? const toHex = (str) => { const chars = str .split('') .map((c) => U+${c.charCodeAt(0).toString(16)}) return chars.filter((c, i) => chars.indexOf(c) === i) .join(','); };
  1. …in reply to @TerribleMia
    After some help from others, here's the final function being used: const unicodeRange = (str) => { const chars = [...str].map((x) => 'U+' + x.codePointAt(0).toString(16)); return chars.filter((c, i) => chars.indexOf(c) === i).join(','); };