mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-06 17:50:39 +08:00
Update String/CheckCamelCase.js
Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
This commit is contained in:

committed by
GitHub

parent
e48f5e2192
commit
8722d52980
@ -10,7 +10,7 @@
|
|||||||
const CheckCamelCase = (varName) => {
|
const CheckCamelCase = (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