Answers for "[variable] javascript"

2

variables in js

var Hello = "World";
let bool = false;
const int = 8788;
Posted by: Guest on December-17-2020
0

js var

var x = 0;

function f() {
  var x = y = 1; // x è dichiarata localmente. y invece no!
}
f();

console.log(x, y); // Genera un ReferenceError in strict mode (y non è definita). 0, 1 altrimenti.
// In modalità non-strict mode:
// x è la globale come si ci aspettava
// però, y è uscita fuori dalla funzione!
Posted by: Guest on January-04-2021

Code answers related to "[variable] javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language