Skip to content

SaishJ/JavaScript-Beginner-to-Advanced

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Variables

Var Keyword

Can be reassigned and are only available inside the function they're created in. Its function scoped.

var variableName = value;

Let Keyword

It can be reassinged but its similar to const i.e. block scoped.

let variableName = value;

Const Keyword

Cannot be reassigned and not accessible before they appear within the code. Its block scoped.

const variableName = value;
Keyword scope Redeclared (within the scope)
var Global or Functional scope Yes
let Block scope (inside {}) No
const Block scope (inside {}) No

What is the block ?

A block is a set of opening and closing curly brackets.

About

Complete Path to JavaScript Beginner to Advanced

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published