Skip to content

Latest commit

 

History

History

variables

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

JavaScript - Variables

Three ways to define variables in JavaScript.

  1. let

    • can be declared only once.
    • can be defined multiple times.
    let firstName = "Ironman";
    • NOTE: camel case is used for let variable names.
  2. const

    • can be declared and defined only once.
    • values of these variables are immutable where we cannot change them again.
    const PI = 3.14;
    • NOTE: uppercase is used for const variable names.
  3. var

    • can be declared and defined multiple times.
    var age = 123;
    • NOTE: camel case is used for var variable names.