Find and Replace Test

JavaScript

/*
Character recognition software is widely used to digitise printed texts. Thus the texts can be edited, searched and stored on a computer.
When documents (especially pretty old ones written with a typewriter), are digitised character recognition softwares often make mistakes.
Your task is correct the errors in the digitised text. You only have to handle the following mistakes:
S is misinterpreted as 5
O is misinterpreted as 0
I is misinterpreted as 1
*/
//////////////////////////////////////////////////////
 
let ln = 'L0ND0N' 			// LONDON
let sg = '51NGAP0RE' 		// SINGAPORE

let ln_New="";
//ChangeText(sg);

var obj = {1: "I", 0: "O", 5: "S"};

input = ln
console.log(ln_New);
ln_New = replaceAll(sg, '1','I');
console.log(ln_New);

function replaceAll(str, find, replace) {
    return str.replace(new RegExp(find, 'g'), replace);
}
function ChangeText(input){
let newText ="";

newText = input.replace("1","I");
newText = input.replace("0","O");
newText = input.replace("5","S");
return newText;
}