Correct use of JavaScript to write multiple meta tags
<p>Hello, I am very new to JS. I would like to ask about my code, how can I write it correctly?</p>
<pre class="brush:php;toolbar:false;">function impScript(scriptURL){
let headTitle = document.querySelector('head');
let setProperty = document.createElement('script');
setProperty.setAttribute('href',scriptURL);
headTitle.appendChild(setProperty);
}
const metaScript = ['ar.js','ar2.js']
impScript(metaScript);</pre>
<p>The code works, but the result is 2script href="ar.js,ar2.js"></script></p>
<p>I want to do this</p>
<pre class="brush:php;toolbar:false;"><script href="ar.js"></script>
<script href="ar2.js"></script</pre>
<p>What should I do? Your answer will be helpful, thank you. </p>