Skip to content

Instantly share code, notes, and snippets.

@dpaez
Last active May 17, 2016 18:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dpaez/cfb7e998ed4aa05acaa0f0a8a213f9c8 to your computer and use it in GitHub Desktop.
Save dpaez/cfb7e998ed4aa05acaa0f0a8a213f9c8 to your computer and use it in GitHub Desktop.
'use strict';
console.log('------------------Let------------------------');
let x = 5;
console.log( 'START scope global > x', x );
function pruebaLet(){
let x = 2;
console.log( '\tscope prueba Let' );
console.log( '\tx >', x );
if (true){
let x = 100
console.log('\t\tscope bloque if x >', x)
};
console.log( '\tx luego de bloque if >', x );
console.log( '\tFIN scope prueba Let' );
}
pruebaLet();
console.log( 'END scope global > x', x );
console.log('------------------Var------------------------');
var y = 5;
console.log( 'START scope global > y', y );
function pruebaLet2(){
var y = 2;
console.log( '\tscope prueba Let' );
console.log( '\ty', y );
if (true){
var y = 200;
console.log('\t\tscope bloque if y', y)
};
console.log( '\ty luego de bloque if >', y );
console.log( '\tFIN scope prueba Let' );
}
pruebaLet2();
console.log( 'END scope global > y', y );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment