mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-07 11:08:54 +08:00
fix: throw error instead of returning it (#1624)
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
const CheckPascalCase = (VarName) => {
|
||||
// firstly, check that input is a string or not.
|
||||
if (typeof VarName !== 'string') {
|
||||
return new TypeError('Argument is not a string.')
|
||||
throw new TypeError('Argument is not a string.')
|
||||
}
|
||||
|
||||
const pat = /^[A-Z][A-Za-z]*$/
|
||||
|
Reference in New Issue
Block a user