Avatar of interclubs

asked on 

Simple Javascript Template...

I'm looking to do a simple javascript template function, something would work like this:

var data = {name: 'john', age:'22'};

var template = 'Hi {name} what is your {age}';

parseTemplate(date, template);

Which would return:
"Hi john what is your 22'
But obviously I would want it to work with any data/template being passed in, not jus this one example.

Avatar of undefined
Last Comment

8/22/2022 - Mon