title: Replacing items within a string
body: <p>I currently have this general error message in my script, which I would like to replace with more specific details. </p>
  
  <pre><code>errorMessage: "Your selected file, {{fileName}}, is not a proper format of {{formats}}"
  </code></pre>
  
  <p>I would like to replace <code>fileName</code> with the name of the file they selected.</p>
  
  <p>This is what I have working so far: </p>
  
  <pre><code>validateError(
     errorMessage.replace(/{{formats}}/, formatArray)
  );
  </code></pre>
  
  <p>So I tried this: </p>
  
  <pre><code>validateError(
         errorMessage.replace(/{{formats}}/, formatArray),
         errorMessage.replace(/{{fileName}}/, inputFile.name)
      );
  </code></pre>
  
  <p>when I run this the {{fileName}} appears this way and is not replaced by the file name. The <code>inputFile</code> is a declared variable that already has the file data info so I know that the name does exist. </p>
  
  <p>What am I doing wrong or overlooking?</p>