I'm currently learning NodeJS after working with Python for the last few years.
In Python I was able to save a string inside a JSON with dynamic parameters and set them once the string loaded, for example:
MY JSON:
j = {
"dynamicText": "Hello %s, how are you?"
}
and then use my string like that:
print(j['dynamicText'] % ("Dan"))
so Python replaces the %s
with "Dan
".
I am looking for the JS equivalent but could not find one. Any ideas?
** Forgot to mention: I want to save the JSON as another config file so literals won't work here