JS Basic

Data type

const string = 'string'
const number = 2
const boolean = true //true or false

console.log(string,'<-- that is string and that is number-->',number)
console.log(boolean,' This is booelan consists of true or false only') 

var / const

var thisIsVar = "Old var"
const thisIsConst = "Old const"

console.log(thisIsConst,'this is const')
console.log(thisIsVar,'this is var')

console.log('================ see which const/let is changed')

thisIsconst = "Change To new Const"
thisIsVar = "Change to new var"

console.log(thisIsConst,'this is const')
console.log(thisIsVar,'this is var')

console.log('================ var is changeable but const is not')

Last updated

Was this helpful?