Skip to content

Instantly share code, notes, and snippets.

@jfirebaugh
Created January 24, 2012 00:21
Show Gist options
  • Select an option

  • Save jfirebaugh/1666851 to your computer and use it in GitHub Desktop.

Select an option

Save jfirebaugh/1666851 to your computer and use it in GitHub Desktop.
foo =
a: "a"
b: "b"
c: "c"
foo ||=
a: "a"
b: "b"
c: "c"
foo ?=
a: "a"
b: "b"
c: "c"
var foo;
foo = {
a: "a",
b: "b",
c: "c"
};
foo || (foo = {
a: "a"
});
({
b: "b",
c: "c"
});
if (foo == null) {
foo = {
a: "a"
};
}
({
b: "b",
c: "c"
});
/* Expected:
var foo;
foo = {
a: "a",
b: "b",
c: "c"
};
foo || (foo = {
a: "a",
b: "b",
c: "c"
});
if (foo == null) {
foo = {
a: "a",
b: "b",
c: "c"
};
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment