I want to create a replica of python's f-strings, not for any real reason, only for fun.
What I want:
f`Value of variable: {variable}`
Is there a way to do something like this? (pun intended)
function f(str) {
return str.replace(/\{(\w+)\}/g, (_, ident) => caller[ident]);
}
No big deal if it isn't possible, I'm just curious.