<!DOCTYPE html>
<html>

  <head>
    <script data-require="ramda@*" data-semver="0.17.1" src="https://cdn.rawgit.com/ramda/ramda/master/dist/ramda.js"></script>
    <link rel="stylesheet" href="style.css" />

  </head>

  <body>
    <h1 id="output"></h1>
    
    <script src="script.js"></script>
  </body>

</html>
// we don't need to require in Plunker!
// const R = require('ramda')

const teams = [
  {name: 'Lions', score: 5},
  {name: 'Tigers', score: 4},
  {name: 'Bears', score: 6},
  {name: 'Monkeys', score: 2},
]

const sortByScoreDesc = R.sort((a,b) => b.score - a.score)
const getName = R.prop('name')

const getTopName = R.pipe(
  sortByScoreDesc,
  R.head,
  getName
)

const result = getTopName(teams)
console.log(result)
document.getElementById('output').innerHTML = `Top team is ${result}`;
/* Styles go here */