Created
October 22, 2021 09:52
-
-
Save Cst2989/3b6542eadca2fa562b861ff6b06327be to your computer and use it in GitHub Desktop.
Validating inputs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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