Generally, menus are going to be filled with static items. A “set it and forget it” kind of thing. In those cases, there are some really good methods of setting up various menus to display based on a user’s login status (here and here).
But what if that’s the case? What if you have a menu that you will dynamically be adding content to and you just want one menu to do it all? This filter function might suit your needs.