Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

var vs let js

let: //only available inside the scope it's declared, like in "for" loop, 
var: //accessed outside the loop "for"
Comment

difference between let and var in javascript

//let
1. It's used in block-scoped.
2. It does not allow to redeclare variables.	
3. Hoisting does not occur in let.
// var 
1. It's used in function scoped.
2. It allows to redeclare variables.
3. Hoisting occurs in var.
Comment

js var vs let

let = 10 // accessable only in defined scope
var = 10 // accessable in the function it is declared in (global variable in a function)
  
Comment

what to use let vs var js

/* DIFFERENCE BETWEEN LET AND VAR */

//LET EXAMPLE
{
  let a = 123;
};

console.log(a); // undefined

//VAR EXAMPLE
{
  var a = 123;
};

console.log(a); // 123
Comment

var vs let javascript

var makes a grobal variable
let makes a local variable
Comment

PREVIOUS NEXT
Code Example
Javascript :: convert json string to byte array java 
Javascript :: visual studio node.js mac 
Javascript :: components should be written as a pure function 
Javascript :: inline null check javascript 
Javascript :: leaflet update marker icon 
Javascript :: how to set onmouseover in javascript 
Javascript :: how to add class in javascript dynamically 
Javascript :: find second largest number in array javascript 
Javascript :: uppercase 
Javascript :: input element change event data 
Javascript :: return response from async call 
Javascript :: get all database react native 
Javascript :: react hook form validation controller 
Javascript :: javascript factory functions 
Javascript :: React native pdf creater html-to-pdf 
Javascript :: react native spinkit 
Javascript :: html form structure 
Javascript :: Find Dubplicate In Array of Object 
Javascript :: has class in jquery 
Javascript :: olx clone react 
Javascript :: if else function react native 
Javascript :: react native position 
Javascript :: reactstrap search bar 
Javascript :: click tester 
Javascript :: infinite loop example 
Javascript :: ngmodel validation angular 8 
Javascript :: style through javascript 
Javascript :: Session Time Out 
Javascript :: return the first matching object from an array 
Javascript :: jquery change label content 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =