Advertisement
Guest User

Untitled

a guest
Feb 4th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let myMap = new Map()
  2. myMap.set('Theta', new Map())
  3. myMap.get("Theta").set('Flying Shrimp', 10)
  4. myMap.set('Sigma', new Map())
  5. myMap.get('Sigma').set('Space cow', 380)
  6. myMap.set('Tau', new Map())
  7. myMap.get('Tau').set('Flying Shrimp', 165)
  8.  
  9.  
  10. let myMapSorted = new Map([...myMap.entries()].sort((x,y)=> { return [...y[1].entries()][0][1] - [...x[1].entries()][0][1]}))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement