So to practice javascript I'm making a little game and I ran into a problem that I have not idea how to solve.
I want to replace the character/letter in the word by a array or index number. For example "letter"
0: l
1: e
2: t
3: t
4: e
5: r
So in this case I want to change 3th character to character "b" making it to be "letber"
var newStr = myStr.replace(/_/t, "b"); This approach is not optional for me, it would ruin the purpose of my game.
I also took a look into .slice and .replace options but i couldn't figure out how to use it the way I explained.