Answers for "What is the difference between variables created using let, var, and const?"

2

difference in var let and const

var: 
	* hoisted(global scope)
    * function scope
let:
    * block scope
    * reassignable
    * not redeclarable
const: 
    * block scope
    * not reassignable
    * not redeclarable
Posted by: Guest on August-10-2021
0

let and var difference

function run() {
  var foo = "Foo";
  let bar = "Bar";

  console.log(foo, bar);

  {
    let baz = "Bazz";
    console.log(baz);
  }

  console.log(baz); // ReferenceError
}

run();
Posted by: Guest on August-20-2020
-1

what is the different between var and let and const in js

var tester = "hey hi";
    
    function newFunction() {
        var hello = "hello";
    }
    console.log(hello); // error: hell
o is not defined
Posted by: Guest on July-30-2021

Code answers related to "What is the difference between variables created using let, var, and const?"

Browse Popular Code Answers by Language