My point was that if I had to have one gun I'd choose the 870 over the AR. I say that as the shotgun has many more choices of ammo, from nonlethal loads, to birdshot, buckshot, slugs, cut shells, and probably some others that I can't think of or don't know about. A shot gun is an excellent close range weapon and can be effective out far enough to keep people away from your home. It can also be used for hunting where in my state it's illegal to hunt game with a 223/556 AR. And I think all semiauto rifles (but I may be mistaken).
For longer ranges, an AR is much better. For cases where you have a lot of folks and need to reload faster the AR is much better. But for general flexibility the shotgun gets the nod in my book.
It really just depends on what you need, what you want, what you're limited to etc. Thankfully I don't have to choose. So the combo of a pistol, rifle and shotgun are part of my defense system. Add my dog, extra cars around the house, and good neighbors and we have a decent setup.