I want to change every other character (starting from the second) in my string to the value "K".
The variable name which I am using is shown to be "deprecated" in VS Code.
Here is my code:
let name = "mellow";
for (x = 0; name.length > x; x++) {
if (x % 2 != 0) {
name[x] = "K"
}
}
console.log(name);