what is require()??
require is a function that allows us to work with modules defined in separate files. If u are familiar with C then require is similar to include.
Basically, it allows to have interaction with the user via the console in a synchronous manner.
To get the user input one can use 'question'
var input =readInput.question('Helooooo what's ur name?');
//the user's response is stored in the variable 'input'
It basically a styling library for your terminal. You can also chain multiple styles!!
read more about it here.... Chalk js Documentation
A method that allows a function to be executed on every element of the list just as any regular for loop does.
array.forEach(function(currentValue, index, arr))
- currentValue= the current element being worked on
- index = index of the current element
- arr=array object the current object belongs to
The complete code can be found here