DEV Community

Siddharth Kanojiya
Siddharth Kanojiya

Posted on

{#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)