Zhorzh

Untitled

Jan 25th, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. const findTheUsable = (data) => {
  2. // const usableArray = data.map(user=>user.usable).flat()
  3.  
  4. // your code ends here
  5. return data.filter(user=>user.usable.filter((key)=>{
  6. let acc = {}
  7. if(Object.keys(user).includes(key)){
  8. acc[key] = user.key
  9. }
  10. return acc
  11. }))
  12. }
Advertisement
Add Comment
Please, Sign In to add comment