Skip to content

Instantly share code, notes, and snippets.

@Cst2989
Created October 22, 2021 09:52
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 Cst2989/3b6542eadca2fa562b861ff6b06327be to your computer and use it in GitHub Desktop.
Save Cst2989/3b6542eadca2fa562b861ff6b06327be to your computer and use it in GitHub Desktop.
Validating inputs
export const bowlingScore = (inputRolls) => {
if (
inputRolls.length < 20 ||
inputRolls.length > 21 ||
inputRolls.some((roll) => roll < 0)
) {
return 'Invalid rolls input';
}
let totalScore = 0;
return totalScore;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment