how to fill html datalist with array values in javascript

JavaScript
let str='';
let htmlstring = Names.forEach((name) => {
            str += '<option value="' + name + '" />';
          });

//paste var str into html 
Source

Also in JavaScript: