For this Question: Implement the function <code>correctMistake</code>, which should take a string which will be the string we want to change the mistake in, and another string which is the wrong word or character, and third string which is the correct version and return its result as a string with mistakes (Use JS In built functions)Function will take 3 args,
1) line arg which is the string with mistakes
2) incorrectWord(or char) which is the char/word which needs to be replaced
3) toBeReplacedWithChar which is a stringFunction will return string with corrected mistakesconsole. log(correctMistake("Hi World world", "world", "of coding")) // prints "Hi World of coding" since world is replaced by empty char

console. log(correctMistake("hi hi hi", "hi", "hello")) // prints "hello hello hello", I have written this Solution Code: function correctMistake(line, charToBeReplaced, what) {
    // write code here
    // return the output , do not use console.log here
    return line.replace(new RegExp(charToBeReplaced,'g'), what)
}, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?