Variables are used to store data.So we can use it later.

Variable names or Identifiers

Variable names can contain:

Important: Variable names can contain numbers

but they can't start with numbers.

White spaces are also not allowed.

    a             // ok
    
    name          // ok
    
    $name         // ok
    
    students_name // ok
    
    student_1     // ok
    
    1_b           // invalid because it starts with a number
    
    my-name       // invalid because it has a dash (only underscores are allowed)
    
    my name       // invalid because it contains a white space
    
    new           // invalid because 'new' is a Javascript reserved word, like will be explained below.

If you speak a foreign language avoid using characters that don't exist in english, like ç, å, é, д, 国, etc

Keywords

Keywords (or reserved words) are used for internal functions and commands and therefore can't be used as variable names. See below some examples of keywords: