Problem is solved!

Hi Guys ! I just started coding js !
I use this code to increase each character in name by 1 ! but doesnt get there !
thanks for debugging guys

var name="ABCD";
var code=name.charCodeAt(i);//get ascii code
code++;//add 1
var char=String.fromCharCode(code);//convert code to character
name=name.replace(name[i],char);//replace index with converted char + 1

Hey there,

nice to meet you! :wave:

Your replace function replaces the first place where it finds the value of name[i]. It does not replace at this place.

Iteration 1: search for the first value A and replace it with B => BBCD.
Iteration 2: search for the first value B and replace it with C => CBCD.

You can read about it on MDN:

If pattern is a string, only the first occurrence will be replaced.

Thanks buddy ! I checked on that ! I ll try the split method instead !
thank you