Following code does not work correctly
var clientContext = new SP.ClientContext.get_current();
var tSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(clientContext);
var ts = tSession.getDefaultSiteCollectionTermStore();
var tset = ts.getTermSetsByName("myTermSet", 1033);
var terms = tset.get_terms();
It returns an error and says Object doesn't support property or method get_terms
But this code returns all terms correctly
var termSetId = "b48ce920-3051-4e96-b9af-55ddc1fa3f2b";
var clientContext = new SP.ClientContext.get_current();
var tSession = SP.Taxonomy.TaxonomySession.getTaxonomySession(clientContext);
var ts = tSession.getDefaultSiteCollectionTermStore();
var tset = ts.getTermSet(termSetId);
var terms = tset.get_terms();
I don't want to use the guid of the term set inside my code. How do I make the first code snippet to work?