title: Should I execute a function multiple times or use an array to loop through?
body: <p>I have a bit of code to replace text in an existing website via Google Tag Manager. </p>
  
  <p>I first find the parent element, and then the child elements to replace the text. Like this:</p>
  
  <pre><code>doReplacement(".parent-element", ".first-child", ".second-child", "Text to be replaced", "Replacement text");
  </code></pre>
  
  <p>Is it better to do multiple runs of doReplacement with different values each time, or is it better to create an array to loop through? Which is faster?</p>