While declaring any variable we can use either var, let or const. In JavaScript, variables are initialized with the value of undefined when they are created. What that means is if we try to log the declaration variable, we’ll get undefined. e.g:
var name;
console.log(name); // this will print 'undefined'
var name;
console.log(name); // this will print 'undefined'