javascript var let
// var has function scope.
// let has block scope.
function func(){
if(true){
var A = 1;
let B = 2;
}
A++; // 2 --> ok, inside function scope
B++; // B is not defined --> not ok, outside of block scope
return A + B; // NaN --> B is not defined
}let /*Var name*/ = /*what is equals*/
Also in JavaScript:
- javascript subset of object array matching certain property
- How to remove the first and the last character of a string
- get channel id discord js v12
- javascript settimeout loop
- alertify js vue
- javascript date today dd mm yyyy
- check window resize javascript
- get height use js
- dustjs compilator
- discord delete messag
- js obj getting count of properties
- mysql json change key
- email collapsible section
- user input through js
- cannot access function before initialization js
- remove duplicate objects from array javascript
- Vuejs v-model when enter pressed
- js scroll page horizontally with mouse wheel
- js jwt decode
- interceptor error handling angular 9
- javascript take first element of array
- javascript randomly shuffle array
- js scroll to id
- chart.js on hover and onclick event