title: How to find a node in a tree with JavaScript
body: <p>I have and object literal that is essentially a tree that does not have a fixed number of levels. How can I go about searching the tree for a particualy node and then return that node when found in an effcient manner in javascript?</p>
  
  <p>Essentially I have a tree like this and would like to find the node with the title 'randomNode_1'</p>
  
  <pre><code>var data = [
  {
  title: 'topNode',
   children: [
     {
         title: 'node1',
         children: [
         {
             title: 'randomNode_1'
         },
         {   
             title: 'node2',
             children: [
             {
                 title: 'randomNode_2',
                 children:[
                 {   
                     title: 'node2',
                     children: [
                     {
                         title: 'randomNode_3',
                     }]
                 }
                 ]
             }]
         }]
     }
    ]
   }];
  </code></pre>