Skip to content

Instantly share code, notes, and snippets.

@johnnonolan
Last active August 29, 2015 14:14
Show Gist options
  • Save johnnonolan/b5eaf08fc1ecb36ca3f6 to your computer and use it in GitHub Desktop.
Save johnnonolan/b5eaf08fc1ecb36ca3f6 to your computer and use it in GitHub Desktop.
curlyBraces
//this looks like it should return a js object
function something() {
return
{
an: "object";
};
}
#this actually returns the object
function something2() {
return {
an: "object";
};
}
#this is what something is actually doing, returning before it gets to the obj definition
function something3() {
return; //note a semi-colon has been autoinserted returning the func, just to mess with you.
{
an: "object";
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment