title: Javascript object not pushing into an Array
body: <p>I'm trying to object push into an Array, which is not not happening it return empty object array. LIke this [{},{}], not showing the values.</p>
  
  <p>Here is my JS code.</p>
  
  <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>function sendFormValues() {
              var result_arr = [];
              var kids = $(".panel-group").map(function() {
  
                  kidName = $(this).find('.kid-name').text();
                  kidAge = $(this).find('.kid-age').text();
  
                  if (kidName || kidAge) {
                      var obj = {
                          kidName: kidName,
                          kidAge: kidAge
                      };
                      console.log(obj); //** Here object print correctly.**
                      result_arr.push(obj);
                      console.log(result_arr); //** here showing empty object. line []**/
                  }
                  return result_arr;
              }).get();
              console.log(result_arr); /** // printing like [{},{}]**/
          }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div class="panel-group"&gt;
          &lt; div class=" panel-heading " &gt;
              &lt;a class="kid-name "&gt;Some dynamic value&lt;/a&gt;
              &lt;a class="kid-age "&gt;Some dynamic value&lt;/a&gt;
        &lt;/div &gt;
        &lt;/div &gt;
      &lt;a href="javascript() " onclick="sendFormValues() "&gt;Send value&lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Can anyone help here what i'm doing mistake here?</p>
  
  <p>Thanks in advance.</p>