You can use REST API to get the information, how you divide it to 2 drop downs is your logic in JQuery
Navigation in SharePoint has two types.
Creating Navigation in the Quick Launch( i..e Left Navigation)
Creating Navigation in Top Navigation bar (i..e Top links on the page)
To create the above navigations we have separate endpoints respectively
QuickLaunch EndPoint :
Below post can give you more information on this