Advertisement
greedydev

Untitled

Nov 5th, 2022
790
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let refactorUser = (user) => {
  2.   let refactoredUser = {
  3.     gender: user.gender.charAt(0).toUpperCase() + user.gender.slice(1),
  4.     title: user.name.title,
  5.     full_name: user.name.first + " " + user.name.last,
  6.     city: user.location.city,
  7.     state: user.location.state,
  8.     country: user.location.country,
  9.     postcode: user.location.postcode,
  10.     coordinates: user.location.coordinates,
  11.     timezone: user.location.timezone,
  12.     email: user.email,
  13.     dob: user.dob.date,
  14.     age: user.dob.age,
  15.     phone: user.phone,
  16.     picture_large: user.picture.large,
  17.     picture_thumbnail: user.picture.thumbnail,
  18.   }
  19.  
  20.   return refactoredUser;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement