Skip to content

Instantly share code, notes, and snippets.

@manakuro
Created March 31, 2020 23:57
Show Gist options
  • Save manakuro/b87e240d9c58954f1796596e6742117d to your computer and use it in GitHub Desktop.
Save manakuro/b87e240d9c58954f1796596e6742117d to your computer and use it in GitHub Desktop.
const person = { score: 25 };
let newScore = person.score
newScore = newScore + newScore
newScore += 7
newScore = Math.max(0, Math.min(100, newScore));
console.log(newScore) // 57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment