title: How do I use underscore.js in angular 9 project
body: <ol>
  <li>Added the package using <strong><em>npm install underscore</em></strong></li>
  <li>in angular.json added </li>
  </ol>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>"scripts": [
                "node_modules/underscore/underscore.js"
              ]</code></pre>
  </div>
  </div>
  </p>
  
  <ol start="3">
  <li>In app.component.ts added following lines.</li>
  </ol>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>import { underscore } from 'underscore';
  declare var _:any;
  let groupedArrayByStartTime = _.groupBy(
              inputWordsArray,
              'start'
            );</code></pre>
  </div>
  </div>
  </p>
  
  <p>when I run the code, error is: <strong>ERROR TypeError: Cannot read property 'groupBy' of undefined</strong></p>
  
  <p>What am I doing wrong here. Thanks for your help.</p>