title: javascript convert or wrap object into array for complex JSON
body: <p>I have a JSON that looks something like this:</p>
  
  <pre><code>var countries = [
  {
    name: 'united states',
    program: {
                name: 'usprogram'
             }
  },
  {
    name: 'mexico',
    program: {
                name: 'mexico program'
             }
  },
  {
    name: 'panama',
    program: [
               {
                 name: 'panama program1'
               },
               {
                 name: 'panama program2'
               }
             ]
  },
  {
    name: 'canada'
  }
  ];
  </code></pre>
  
  <p>Is there a way to ALWAYS wrap the <code>countries.programs</code> object into an array such that the final output looks something like this?  I tried some of the utility functions in underscoreJS, but the solution has eluded me.</p>
  
  <pre><code>var countries = [
  {
    name: 'united states',
    program: [    //need to wrap this object into an array
               {
                name: 'usprogram'
               }
             ]
  },
  {
    name: 'mexico',
    program: [   //need to wrap this object into an array
               {
                 name: 'mexico program'
               }
             ]
  },
  {
    name: 'panama',
    program: [
               {
                 name: 'panama program1'
               },
               {
                 name: 'panama program2'
               }
             ]
  },
  {
    name: 'canada'
  }
  ];
  </code></pre>
  
  <p>Thanks!</p>