isValidVarName()

Determines if a string can be used as a variable name in JavaScript.

This function is valid in v2.10.1 to v2.22.1. This function has been downloaded 27 times.

Parameter

{string} varName
The string to be tested to see if it is a valid variable name.

Returns

{boolean}
true if the string value of varName is a valid variable name in JavaScript, otherwise false.

Requiring Functions

This function is directly required by the following functions:

  • blockify()
    Creates global variables and when the returned code is executed via eval() the global variables will be deleted and will only be included in the block in which eval() executes.
  • uneval()
    Creates a string representation of the given object or primitive.