Skip to content

Instantly share code, notes, and snippets.

@chubas
Created November 24, 2010 17:29
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 chubas/3687b09f40b6a1194999 to your computer and use it in GitHub Desktop.
Save chubas/3687b09f40b6a1194999 to your computer and use it in GitHub Desktop.
var x = "some initial value"
some_var = (function {
var x = 10; // We can declare a local variable 'x' here. In Ruby you can't
return x + 2;
})();
x // => Still "some initial value"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment