Skip to content

Instantly share code, notes, and snippets.

@h3nr1ke
Last active December 24, 2018 12:37
Show Gist options
  • Save h3nr1ke/6b36deef368a157abdfdff60fe5d1e88 to your computer and use it in GitHub Desktop.
Save h3nr1ke/6b36deef368a157abdfdff60fe5d1e88 to your computer and use it in GitHub Desktop.
var example ECMA6
/**
*
*/
_myVar = "Banana"; // using a var before its is declared
console.log(_myVar);
var _myFunction = function(){
 _myVar = "Apple"; // using before the declaration
 console.log("_myVar -> " + _myVar); 
};
_myFunction(); // calling the variable before the declaration
var _myVar;
console.log(_myVar);
//END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment