Let's try mozilla's fixedCharAt function

master
Chloe Fontenot 🏳️‍⚧️ 2023-04-30 20:03:50 +07:00
parent 0d29908fcc
commit 512ee8d11d
1 changed files with 3 additions and 2 deletions

@ -217,8 +217,9 @@ function charIterate(input) {
let temp = input.split(''); let temp = input.split('');
for (let i = 0; i < stringLength; ++i) { for (let i = 0; i < stringLength; ++i) {
let compareString = temp.join(""); let compareString = temp.join("");
console.log(surrogatePairs.exec(compareString)); console.log(surrogatePairs.exec(compareString), compareString);
if (surrogatePairs.exec(compareString).index == i) { let eval = surrogatePairs.exec(compareString).index;
if (eval != null && eval == i) {
stringLength--; stringLength--;
console.log("Decreasing stringLength variable to", stringLength); console.log("Decreasing stringLength variable to", stringLength);
} }