The person who wrote the code you’re looking has to have written a function replaceAt†, it’s not a built-in method, that’s why you can’t find any documentation.
† …that they attached to the String prototype so that they could do "some string".replaceAt(0, ...etc)
Note: this is just for example purposes, don’t do this in practice. Monkey-patching JavaScript builtins is not really advisable. For one thing, it’s extremely confusing when you end up with code that looks like it’s just using built in functions when in fact it’s custom stuff, as you have discovered.
Did you look at the documentation on the for…in loop? It’s just a variable name like the other examples on the MDN link. I don’t particularly like the cryptic variable name the author choose though.
It’s just a variable, it can be called anything. In a loop, you normally have a variable which you use to track the current item, and that variable needs a name. The variable has some value assigned to it so you can access the value in the loop body. Then the loop runs and the variable is assigned the next value so you can access it and so on.
Here it’s called “KEY”
for (var KEY in someObject) {
console.log(someObject[KEY]);
}
Here it’s called “INDEX”:
for (var INDEX = 0; INDEX < someArray.length; INDEX++) {
console.log(some array[INDEX]);
}
Here it’s called “ITEM”:
for (var ITEM of someIterable) {
console.log(ITEM);
}