Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function phoneBook(input) {
- let obj = input.reduce((acu, count) => {[user, phone] = count.split(" ")
- acu[user]=(phone); return acu },{})
- Object.entries(obj).map(x=>console.log(`${x[0]} -> ${x[1]}`))
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement