for(let [key,val] in obj){ messageBody = messageBody.replace("{"+ key + "}",val) } code example
Example 1: for(let [key,val] in obj){ messageBody = messageBody.replace("{"+ key + "}",val) }
for (let key in obj){
messageBody = messageBody.replace("{"+ key + "}", obj[key])
}
Example 2: for(let [key,val] in obj){ messageBody = messageBody.replace("{"+ key + "}",val) }
for(let [key,val] in obj){
messageBody = messageBody.replace("{"+ key + "}",val)
}