Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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.
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #difference #var #javascript
ADD COMMENT
Topic
Name
1+2 =