<div>
<p>foo</p>
<p>bar</p>
<p>baz</p>
</div>
document.addEventListener('DOMContentLoaded', function(){
let arr = ['foo', 'bar', 'baz'];
/* Native JS */
let containerJS = document.createElement('div');
[].map.call(arr, function(_el){
let _p = document.createElement('p');
_p.innerHTML = _el;
containerJS.appendChild(_p);
});
document.body.appendChild(containerJS);
/* jQuery */
let containerJQ = $('<div></div>').appendTo($('body'));
$.each(arr, function(_idx, _el){
$('<p></p>').html(_el).appendTo(containerJQ);
});
});