title: nodejs how can i use multidimensional array and push values in it?
body: <p>i am trying to create a new <code>multidimensional array</code> from the data i am getting from 3rd part API.</p>
  
  <pre><code>"output":[
    {
       "is_indb":false,
       "name":"adam",
       "tokens":29
    },
    {
       "is_indb":true,
       "name":"aaron",
       "tokens":2,
    },
    {
       "is_indb":false,
       "name":"adam",
       "tokens":3,
    },
    {
       "is_indb":false,
       "name":"axel",
       "tokens":5,
    },
    {
       "is_indb":false,
       "name":"andy",
       "tokens":5,
    },
    {
       "is_indb":false,
       "name":"bob",
       "tokens":5,
    },
    {
       "is_indb":false,
       "name":"aldo",
       "tokens":5,
    },
    {
       "is_indb":false,
       "name":"julia",
       "tokens":5,
    }
  ]
  </code></pre>
  
  <p>i would like to create a new <code>array</code> and fill it with data from response.
  but i would like to do some pre checks like</p>
  
  <p>take only those whose, <code>is_indb = false</code>
  take only those whose, name starts with <code>a</code></p>
  
  <p>so the final array will be, all those whosse <code>is_indb = true</code> and name starts with <code>a</code></p>
  
  <pre><code>var newaray = [[adam,29],[adam,3],[axel,5],[andy,5],[aldo,5]];
  </code></pre>
  
  <hr>
  
  <p>so far i have tried using <code>_pluck</code> and getting some weird outputs. i am able to get sible elements using <code>_pluck</code> but cant get multiple items.</p>
  
  <p>i can think of logic like this</p>
  
  <pre><code>var newaray = [];
  
  if( (_pluck(msg.output,'is_indb') == false  &amp;&amp; ((_pluck(msg.output,'name').substring(0, 1) == "a")){
      newaray.push( [ _.pluck(msg.output, 'name') , _.pluck(msg.output, 'token')] );
  }
  </code></pre>