Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let refactorUser = (user) => {
- let refactoredUser = {
- gender: user.gender.charAt(0).toUpperCase() + user.gender.slice(1),
- title: user.name.title,
- full_name: user.name.first + " " + user.name.last,
- city: user.location.city,
- state: user.location.state,
- country: user.location.country,
- postcode: user.location.postcode,
- coordinates: user.location.coordinates,
- timezone: user.location.timezone,
- email: user.email,
- dob: user.dob.date,
- age: user.dob.age,
- phone: user.phone,
- picture_large: user.picture.large,
- picture_thumbnail: user.picture.thumbnail,
- }
- return refactoredUser;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement