<!DOCTYPE html>
<html>

  <head>
    <script data-require="ramda@*" data-semver="0.22.1" src="https://unpkg.com/ramda@0.22.1/dist/ramda.min.js"></script>
    <link rel="stylesheet" href="style.css" />
  </head>

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

</html>
// make console.log write to the page for better in-browser experience
(function () {
  var body = document.querySelector('body');
  body.style['fontFamily'] = 'monospace';
  body.style['fontSize'] = '2em';
  console.log = function (x) { body.innerText += JSON.stringify(x) + '\n'; };
}());

// const R = require('ramda')
const {find, propEq, useWith, identity} = R

const countries = [
  {cc: 'GB', flag: 'πŸ‡¬πŸ‡§'},
  {cc: 'US', flag: 'πŸ‡ΊπŸ‡Έ'},
  {cc: 'CA', flag: 'πŸ‡¨πŸ‡¦'},
  {cc: 'FR', flag: 'πŸ‡«πŸ‡·'}
]

// const getCountry = (cc, list) => find(propEq('cc', cc), list)
const getCountry = useWith(find, [propEq('cc'), identity])

const result = getCountry('FR', countries)
console.log(result)
/* Styles go here */