how to respawn Enemies and Targets

I’m almost done! all I need to do is to add code to respawn enemies and targets to this game in JavaScript.
Anyone have any ideas? there aren’t many sources with the kind of code I’m looking for.

Replit: Join AnaeliRivera's "EnemyGame " - Replit

One of the best YT channels for JS game dev is

check out Performance optimisations
and State mangement

I’ve used both finite state machines and the object pool method for a few projects and the performance is great…

Hmmm, I have seen his videos; they did help. however not for this particular instance.
But I do want some thoughts on how I should go about this.

Should I refresh the whole page seconds after defeating the last enemy or should I have an enemy spawn right after one is deleted?

I’m asking because I already have this code:

},2000) // Reload after 2 seconds

Of course, I can just go the easy way and just refresh the page in 2 seconds.

Or the more practical but difficult way.

What are your thoughts and advise if any?