DEV Community

Siddharth Kanojiya
Siddharth Kanojiya

Posted on

1

{#3}const, let and var in JavaScript | JavaScript

console.log("JavaScript tutorial 3: var, let and const")
// var a = 45;
// var a = "p"
let b = "Sage";
const author = "Sage"
author = 5 // Throws an error because constant cannot be changed
b = 4
const Sage = 0;
let c = null
let d = undefined
{
let b = 'this'
console.log(b)
}
console.log(b)

Top comments (0)

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay