title: Convert an object to an array in angular2/typescript
body: <p>Am new to angular and typescript and I have this function</p>
  
  <pre><code> onSetValues(user){ //user is an object
      console.log(user);  
   }
  </code></pre>
  
  <p>The console.log above returns an object of the form</p>
  
  <pre><code>role:"administrator"
  status:10
  tries:2
  </code></pre>
  
  <p>I would like to transform thisto an array so that i can loop through them like</p>
  
  <pre><code>for(var i=0; i&lt;array.length; i++){
   //do m stuff here
    }
  </code></pre>
  
  <p>How do i convert this</p>
  
  <p>I have checked on <a href="https://stackoverflow.com/questions/6857468/converting-a-js-object-to-an-array">this link</a>  but it doesnt offere help in angular2/typescript</p>
  
  <p>I have also tried </p>
  
  <pre><code>console.log(user| {}) //also fails
  </code></pre>