MacOS Mojave shows recent apps in the Dock. Here's how to hide them
You'll find this new addition as either helpful or something that crowds your Mac's Dock.

In addition to Stacks, Dark Mode, a new screenshot tool and an improved Finder, MacOS Mojave has added a new element to the Dock. It now shows your three most recent apps.
This new recent-app section sits between your collections of app icons on the left and the section of the right that shows your open apps.
If you've got your Dock set up just so, then you might not want this new recent-apps section crowding your Dock.
Hide recent apps in Dock
The new recent-apps section is smart enough that it shows only recent apps that aren't already in your Dock. It can be helpful to return quickly to an app you recently closed, but since I have my Dock loaded with all the apps I use with any regularity, it has basically been stuck showing me icons for Pages, Dictionary and Preview.
I rarely open Pages, open the Dictionary only by accident and only open Preview by clicking on a screenshot or PDF. Thus, these recent apps sitting day after day in my Dock are not useful to my Mac workflow.
Thankfully, you can disable the feature. Here's how:
Go to System Preferences > Dock and uncheck the box at the bottom for Show recent applications in Dock.
Computing Guides
Laptops
Desktops & Monitors
Computer Accessories
Photography
Tablets & E-Readers
3D Printers