title: Build string from complex nested object values in Javascript
body: <p>I have the following input.</p>
  
  <pre><code>    [{ name: 'modules',
         children: [ { name: 'home', children: [], allowed: true } ],
         allowed: true },
  
       { name: 'modules',
         children: 
           [ { name: 'new', children: [], allowed: true },
             { name: 'all', children: [], allowed: true } ],
         allowed: true },
  
       { name: 'groups',
         children: 
           [ { name: 'new', children: [], allowed: true },
             { name: 'all', children: [], allowed: true } ],
         allowed: true },
  
       { name: 'users',
         children: 
           [ { name: 'new', children: [], allowed: true },
             { name: 'all', children: [], allowed: true } ],
         allowed: true },
  
       { name: 'settings',
         children: 
           [ { name: 'generally', children: [], allowed: true },
             { name: 'personal', children: [], allowed: true } ],
         allowed: true }]
  </code></pre>
  
  <p>I would like to build string from the values like this: name.children.name.children and so on. I need every possible combination. The nesting can be endless. So a string like 'test.test1.test2.test3' is possible.</p>
  
  <p>So the endresult of the example should be:</p>
  
  <pre><code>'modules.home'
  'modules.new'
  'modules.all'
  'groups.new'
  'groups.all'
  'users.new'
  'users.all'
  'settings.generally'
  'settings.personal'
  </code></pre>
  
  <p>My current solution does not really work..
  Which is the best and most performant solution to achieve this? Thanks in advance! </p>