Guest User

Untitled

a guest
Feb 16th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. const carsEntity: {[key: string]: Car} = {
  2. 'xyz': { id: 'xyz', name: 'Mazda' },
  3. 'abc': { id: 'abc', name: 'Porsche' }
  4. };
  5.  
  6. const transformedEntity1 = Object.keys(carsEntity).map(carId => carsEntity[carId]);
  7.  
  8. const transformedEntity2 = Object.values(carsEntity);
  9.  
  10. const transformedEntity3 = Object.entries(carsEntity);
Add Comment
Please, Sign In to add comment