Skip to content

Instantly share code, notes, and snippets.

View aaronfrost's full-sized avatar
:octocat:
Software Architect Contractor

Aaron Frost aaronfrost

:octocat:
Software Architect Contractor
View GitHub Profile
@aaronfrost
aaronfrost / jsnexteleven.js
Created March 6, 2012 09:00
jsnexteleven
let a = 0;
if(true){
let a = 2;
console.log(“here a = “,a);
}
console.log(“at the end a = “,a);
let foo = 0;
if(true){
let bar = 1;
}
console.log( foo + bar );
//results in runtime error, bar is not defined
var run = undefined;
run(); //error, since undefined isn’t a function
run = function(){
console.log(“running”);
}
run();
run();
var run = function(){
console.log(“running”);
}
run();
function run(){
console.log(“running”);
}
run();
run();
run();
function run(){
console.log(“running”);
}
run();
function run(){
console.log(“running”);
}
var a = 1;
function run(){
var a = undefined;
if(true){
a = 2;
}
}
run();
console.log(a);
var a = 1;
function run(){
if(true){
var a = 2;
}
}
run();
console.log(a);
@aaronfrost
aaronfrost / jsnexttwo.js
Created March 6, 2012 08:26
jsnext two
var foo = undefined;
var bar = undefined;
foo = 0;
if(true){
bar = 1;
}
console.log( foo + bar );