I'm trying to replace some code in js using template literals and came across this anomaly. Could someone explain why the below replacement produces the same output. I've tested it in Chrome(ver.92.0.4515.107) and FireFox too with the same result in the console. Is there something more to template literals.
console.log("word".replace("word", `${"$$test"}`));
//outputs : $test
console.log("word".replace("word", `${"$test"}`));
//outputs : $test
console.log(`${"$$test"}`) // direct console outputs the right value
//$$test