Menu
Hi,
I want to know how many of the same letters are at the end of the string as from the beginning of the string.
for example:
const string = “abcertcba”;
result = 3;
But I got stuck, where is what I have so far
`const string = “abcertcba”;
const counter = 0;
const reversString = string.split(“”).reverse().join(“”);
while(index != string.length / 2 + 1) {
forEach(index) {
}
}`
I don’t know how to compare them.