We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7607915 commit 05699a2Copy full SHA for 05699a2
exercises/practice/reverse-string/.meta/proof.ci.js
@@ -1,7 +1,8 @@
1
export const reverseString = (string) => {
2
let revString = '';
3
- for (let i = string.length - 1; i >= 0; i -= 1) {
4
- revString += string[i];
+ let characters = Array.from(new Intl.Segmenter().segment(String(string)), (x) => x.segment);
+ for (let i = characters.length - 1; i >= 0; i--) {
5
+ revString += characters[i];
6
}
7
return revString;
8
};
0 commit comments