This is a quickie, but can be useful for those accessing SharePoint Managed Metadata from the Client Side.
Often when you’re pulling back data from SharePoint lists, you’ll get a full-fledged object back rather than a single field value (and yes I ran into this while working on some fancy calls in a Display Template).
The code itself is fairly simple, but here’s how you can go digging for an answer yourself. Go to your browser’s debugging console (F12) and inspect the JSON response from the Console for your function. Here, find the correct response for your call that contains the items from the list that you queried. From there, you can see how the objects are structured and how to access the managed metadata field properly. In the picture below, you can see where I have highlighted the metadata field that I am looking for which has a type of SP.Taxonomy.TaxonomyFieldValue.
Hope this helps you guys dig through the response from SharePoint and get you the right field values! Helpful MSDN blog to get you started with client side calls.
Now that you see the structure, the import part of your code is this (after you instantiate the enumerator to parse the items returned from the list):
And the complete code here: