How do I create HTML elements dynamically from an array?

For example, if I got an array `const data = ['123', '456', '789']` , and I wanna create a `p` tag of HTML for each value of the array. I've tried to use the `foreach` method but it's not working, anything I do it wrong so far? Below is the code:

```js
const ct = document.querySelector('.ct');
const data = ['123', '456', '789'];
const createNewElement =
  '<p>' +
  data.forEach((elm) => '<a>elm</a>') +
  '</p>';

ct.insertAdjacentHTML('beforeend', createNewElement);
```

```html
<div class="ct"></div>
```