Skip to content

Instantly share code, notes, and snippets.

@pvdz
Last active December 17, 2015 18:19
Show Gist options
  • Select an option

  • Save pvdz/5652198 to your computer and use it in GitHub Desktop.

Select an option

Save pvdz/5652198 to your computer and use it in GitHub Desktop.
Original example Rewrite to dynamic var: https://gist.github.com/qfox/5652201 Rewrite to global var: https://gist.github.com/qfox/5652207
// Rewrite to dynamic var: https://gist.github.com/qfox/5652201
// Rewrite to global var: https://gist.github.com/qfox/5652207
// original
function start(x){
var foo = 0;
if (x === 1) foo = 1;
else if (x === 2) foo = 2;
else if (x === 3) foo = 3;
else if (x === 4) foo = 4;
else foo = 5;
return foo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment