code: function toChar(cp) {
      if (cp <= 0xffff) {
          return String.fromCharCode(cp);
      }
  
      cp -= 0x10000;
      return String.fromCharCode(((cp >>> 10) & 0x3ff) | 0xd800) + String.fromCharCode(0xdc00 | (cp & 0x3ff));
  }
docs: NOTE: String.fromCharCode() function can handle only characters from BMP subset. So, we need to workaround this manually. (see: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/fromCharCode#Getting_it_to_work_with_higher_values)