We can install this by using npm.
npm install underscore
const _ = require('underscore');
Write your mark-up code regarding the requirement.
We should always place the underscore.js code inside the <script> tag.
In this case, Write the if and else logic based upon a problem statement.
Once the code is error-free we can surf the file as usual.
In this way, we need to write the code in <script> tag;