lets say im making a translate system, it replace all the words that is matched in the array key with the value of the matched array key lets say
translate =
saya: "i",
jalan: "walk",
hutan: "forest",
beli: "buy",
ke: "to",
apel: "apple",
};
string = "SaYa JaLan ke hutan beli Apel" // case insensitive
it should be
string = "I walk to forest buy apple" // the translated string
how can we do that in javascript? in a function so we can call it like
translated = translate(string) // returns the translated string
.replace()method at MDN