How to efficiently generate a mass amount of article containers with javascript

I have a container that is going to hold a lot of article containers structured like this:

<div>
<img />
<h3></h3>
</div>

How can I efficiently generate these through javascript when they vary in data. My idea is to loop and have an array holding the image source, title, and path

I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (').

Yes, you could do it like that.
Create an empty template literal and then use a loop to concatenate each div and associated elements, interpolating your src attributes and other stuff from an array or suchlike as you go.
When you’ve finished adding to the string, you can then set it as the innerHTML of another container element or whatever.