function myLanguages(results) { let final = []; let arr = Object.entries(results); let biggerItem = arr.filter(([key, value]) => value >= 60); let sort = biggerItem.sort((a, b) => a[1] - b[1]).reverse(); sort.map(item => final.push(item[0])) return final } console.log(myLanguages({ "Java": 10, "Ruby": 80, "Python": 65 })) ['Ruby', 'Python']
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter