title: How to take input via console in javascript (node.js)?
body: <p>I am facing difficulties taking input in Javascript. I use nodejs to run js files using the following command:</p>
  
  <pre><code>node filename.js
  </code></pre>
  
  <p>Can someone tell me all the ways in which I can input a 2D matrix from the console?</p>
  
  <p>Also, why is it so difficult in JS? 
  I am looking for a simple method like gets() or something equivalent of cin in C++.</p>