JavaScript Identifiers

JavaScript Identifiers are names used to name variables and keywords and functions.

A identifier must begin with:

  • A letter(A-Z or a-z)
  • A dollar sign($)
  • A underscore(_)

Note: Numbers are not allowed as a first character in JavaScript Identifiers.

JavaScript Case Sensitive

JavaScript Identifiers are case-sensitive.

Example: Both the variables firstName and firstname are different from each other.

Javascript
let firstName = "Geek";
let firstname = 100;

console.log(firstName);
console.log(firstname);

Output
Geek
100

JavaScript Camel Case

In JavaScript Camel case is preferred to name a identifier.

Example:

let firstName
let lastName

JavaScript Character Set

A unicode character set is used in JavaScript. A unicode covers the characters, punctuations and symbols.

We have a complete article on character sets. Click here to read Charsets article.



JavaScript Syntax

JavaScript syntax refers to the rules and conventions dictating how code is structured and arranged within the JavaScript programming language. This includes statements, expressions, variables, functions, operators, and control flow constructs.

Syntax

console.log("Basic Print method in JavaScript");

JavaScript syntax refers to the set of rules that determines how JavaScript programs are constructed:

// Variable declaration
let c, d, e;

// Assign value to the variable
c = 5; 

// Computer value of variables
d = c;
e = c / d;

JavaScript Values

There are two types of values defined in JavaScript Syntax:

  • Fixed Values: These are known as the literals.
  • Variable values: These are called variables

These are the features of JavaScript which have some predefined syntax:

Table of Content

  • JavaScript Literals
  • JavaScript Variables
  • JavaScript Operators
  • JavaScript Expressions
  • JavaScript Keywords
  • JavaScript Comments
  • JavaScript Data Types
  • JavaScript Functions
  • JavaScript Identifiers

Similar Reads

JavaScript Literals

Syntax Rules for the JavaScript fixed values are:...

JavaScript Variables

A JavaScript variable is the simple name of the storage location where data is stored. There are two types of variables in JavaScript which are listed below:...

JavaScript Operators

JavaScript operators are symbols that are used to compute the value or in other words, we can perform operations on operands. Arithmetic operators ( +, -, *, / ) are used to compute the value, and Assignment operators ( =, +=, %= ) are used to assign the values to variables....

JavaScript Expressions

Javascript Expression is the combination of values, operators, and variables. It is used to compute the values....

JavaScript Keywords

The keywords are the reserved words that have special meanings in JavaScript....

JavaScript Comments

The comments are ignored by the JavaScript compiler. It increases the readability of code. It adds suggestions, Information, and warning of code. Anything written after double slashes // (single-line comment) or between /* and */ (multi-line comment) is treated as a comment and ignored by the JavaScript compiler....

JavaScript Data Types

JavaScript provides different datatypes to hold different values on variables. JavaScript is a dynamic programming language, which means do not need to specify the type of variable. There are two types of data types in JavaScript....

JavaScript Functions

JavaScript functions are the blocks of code used to perform some particular operations. JavaScript function is executed when something calls it. It calls many times so the function is reusable....

JavaScript Identifiers

JavaScript Identifiers are names used to name variables and keywords and functions....