Understanding Literal Data Types in JavaScript

Understanding Literal Data Types in JavaScript

Literals in JavaScript

  • In programming a variable's data type is specified as what kind of data is stored in a particular variable.

  • Literals are a special class of data type, and they cover those values that are fixed.

  • Example-

thisDay = "What is the festival today";
  • here is the text "What is the festival today" is a literal string value.

  • JavaScript supports three kinds of literal datatypes :

  1. Numeric Literals

  2. String Literals

  3. Boolean Literals