How can I create an option element using javascript and set it's value : <pre><code>const currencies = [
  {
    id: 'USD', name: 'US Dollars'
  }, {
    id: 'UGX', name: 'Ugandan Shillings'
  }, {
    id: 'KES', name: 'Kenyan Shillings'
  }, {
    id: 'GHS', name: 'Ghanian Cedi'
  }, {
    id: 'ZAR', name: 'South African Rand'
  }
];
</code></pre>

<p>I have an issue with my code. I want to create an option element using javascript. I have done something like this below. What is my issue?</p>

<p>I want each item in the currencies arrays to populate into populateCurrencies function. And it should also create an option element. And also set it's value to the item id.</p>

<pre><code>const populateCurrencies = () =&gt; {  

            var ans = document.getElementById('USD').value;
}
</code></pre>
