Let's try mozilla's fixedCharAt function

This commit is contained in:
Chloe Fontenot 🏳️‍⚧️ 2023-04-30 19:45:26 -05:00
parent 4aded5d3e5
commit 588286b3f1

View File

@ -214,8 +214,9 @@ const surrogatePairs = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
var charIterateState; var charIterateState;
function charIterate(input) { function charIterate(input) {
let stringLength = (input.length - 1); let stringLength = (input.length - 1);
console.log(surrogatePairs.exec(input.charCodeAt(charIterateState)));
for (let i = 0; i < stringLength; ++i) { for (let i = 0; i < stringLength; ++i) {
if (surrogatePairs.exec(input.charCodeAt(charIterateState)) !== null) { if (false) {
stringLength--; stringLength--;
console.log("Decreasing stringLength variable to", stringLength); console.log("Decreasing stringLength variable to", stringLength);
} }