title: Evaluating a string inside a variable
body: <p>I know the basic working of JavaScript template literals. </p>
  
  <pre><code>var name = 'nithin'
  console.log(`hello ${name}`) 
  //this will print "hello nithin"
  </code></pre>
  
  <p>What if my template literal is stored in a DB and I'm dynamically querying the DB to get the corresponding template literal? How can I evaluate this?</p>
  
  <p><strong>This is my scenario:</strong></p>
  
  <p>I have store the template literal in DB as a string since I can't store it with backticks:  </p>
  
  <pre><code>"welcome ${user}"
  </code></pre>
  
  <p>And I'm querying the DB for the string. Suppose I have this string in the variable <code>stringFromDB</code>. Now I want to evaluate this string using template literal method. </p>
  
  <p>I have tried the following, but it isn't working:</p>
  
  <pre><code>eval(`stringFromDb`)
  </code></pre>
  
  <p>I have a variable named <code>user</code> in the same scope which is having a value <code>"nithin"</code>. Im expecting <code>"welcome nithin"</code> as result. Any help?</p>