Back to functions
nerdamer.validVarName
validVarName
This method can be used to check that the variable meets variable name requirements for nerdamer. Variable names Must start with a letter or underscore and
may contains any combination of numbers, letters, and underscores after that.
Usage: nerdamer.validVarName(variable_name)
Parameters
String
variable_name
|
The variable name being validated |
Returns
bool
console.log('cos: ', nerdamer.validVarName('cos'));
console.log('chicken: ', nerdamer.validVarName('chicken1'));
console.log('1chicken: ', nerdamer.validVarName('1chicken'));
console.log('_: ', nerdamer.validVarName('_'));