title: Get GUID By TermName - jsom
body: <p>I need to pass a term name as a parameter and return the GUID of that particular term in SharePoint 2013, JSOM</p>
  
  <p>As an example if I pass "My Term 1" it should return the corresponding GUID of "My Term 1".</p>
  
  <p><img src="https://i.stack.imgur.com/WTtnl.png" alt="enter image description here"></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var termGuid=getTermByName('My Term 1');
  
  function getTermByName(TermName){
    return term.get_id();
  }</code></pre>
  </div>
  </div>
  </p>