Skip to content

Instantly share code, notes, and snippets.

@FagnerMartinsBrack
Last active February 26, 2018 03:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FagnerMartinsBrack/28396275f93bc77582d2c9d6adf7756d to your computer and use it in GitHub Desktop.
Save FagnerMartinsBrack/28396275f93bc77582d2c9d6adf7756d to your computer and use it in GitHub Desktop.
(Medium) - Web Performance
function byteReduction({ from, to }) {
const difference = to - from;
return (100 * difference / from) + '%';
}
console.log('Is this working?', byteReduction({ from: 100, to: 50 }) === '-50%');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment