The function accepts 3 inputs: (string (str), starting point in string (index), and how many characters to remove after that (count)).
function removeFromString(str, index, count) {
let newStr = '';
for (let i = index; i <= (index + count); i++) {
newStr = str.replace(str[i], '');
}
return newStr;
}
It’s returning outputs that may remove one character at most, but nothing more than that, which is not what I am trying to achieve.
What I want is a function that when called, will return a function without the characters specified from the index and count parameters.