title: how to understand below function output for node js
body: <p>I have below function which take result set which has rows(first row is heading) and columns (like dataset in .NET) as input and return output. What output it returns I am not able to understand. I am facing some issues to run Node js app and hence not able to debug it line by line. I really need to understand its purpose. </p>
  
  <pre><code>export const flattenObject = (object) =&gt; {
    return object.reduce((acc, val) =&gt; Array.isArray(val) ?
      acc.concat(flattenObject(val)) : acc.concat(val), []);
  };
  </code></pre>
  
  <p>Could someone please help me to get its output/purpose in code.
  Thanks in advance. </p>