Iterate over indices of codepoints in JavaScript string How can one iterate over the indices of codepoints and their values in a JavaScript string?