Answers for "should you use var in javascript"

SQL
1

js var

var a;
console.log(a);                // scrive in console "undefined" o "" a seconda del browser usato.
console.log('still going...'); // scrive in console "still going...".
Posted by: Guest on January-04-2021
2

variables in js

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

Variables in javascript

var a;                          // variable
var b = "init";                 // string
var c = "Hi" + " " + "Joe";     // = "Hi Joe"
var d = 1 + 2 + "3";            // = "33"
var e = [2,3,5,8];              // array
var f = false;                  // boolean
var g = /()/;                   // RegEx
var h = function(){};           // function object
const PI = 3.14;                // constant
var a = 1, b = 2, c = a + b;    // one line
let z = 'zzz';                  // block scope local variable
Posted by: Guest on August-05-2021
0

js var

console.log(a);                // Genera un ReferenceError.
console.log('still going...'); // Non verrà eseguito.
Posted by: Guest on January-04-2021
0

js var

function x() {
  y = 1;   // Genera un ReferenceError in strict mode
  var z = 2;
}

x();

console.log(y); // scrive "1" in console
console.log(z); // Genera un ReferenceError: z non è definita fuori dalla funzione x
Posted by: Guest on January-04-2021
-1

vars javascript

var /*var*/ = /*What it does*/
Posted by: Guest on September-22-2020

Code answers related to "should you use var in javascript"

Code answers related to "SQL"

Browse Popular Code Answers by Language