Question: Simple JS task that implement a template function Implement a JavaScript class that when supplied with a templateincluding tags enclosed in double curly braces (
Simple JS task that implement a template function
Implement a JavaScript class that when supplied with a templateincluding tags enclosed in double curly braces ( e.g. {{sometag}})produces a string with the tags replaced by values found in aname-value-pair map i.e. a simple JavaScript object.
For example, after running the following code:const t = newTemplater('Hello {{tag}}');let s = t.apply({tag: 'World'});Thevariable swill have the value 'Hello World'.
How does this work ?
Step by Step Solution
3.48 Rating (158 Votes )
There are 3 Steps involved in it
Answer JAVASCRIPT PROGRAM class Templater constructorwords parameterised constr... View full answer
Get step-by-step solutions from verified subject matter experts
