mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
Update String/CheckPascalCase.js
Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
This commit is contained in:

committed by
GitHub

parent
8722d52980
commit
cddfc342b7
@ -10,7 +10,7 @@
|
|||||||
const CheckPascalCase = (VarName) => {
|
const CheckPascalCase = (VarName) => {
|
||||||
// firstly, check that input is a string or not.
|
// firstly, check that input is a string or not.
|
||||||
if (typeof VarName !== 'string') {
|
if (typeof VarName !== 'string') {
|
||||||
return 'Not string(s)'
|
return new TypeError("Argument is not a string.")
|
||||||
}
|
}
|
||||||
|
|
||||||
const pat = /^[A-Z][A-Za-z]*$/
|
const pat = /^[A-Z][A-Za-z]*$/
|
||||||
|
Reference in New Issue
Block a user