Create a gist now

Instantly share code, notes, and snippets.

MyObj = {
foo: "bar",
// ...
stuff: function(){
if (this.foo === "bar"){
this.doSomething();
} else {
this.doAnotherThing();
}
},
moreStuff: function(){
if (this.foo === "bar"){
this.otherStuff();
} else {
this.moreStuff();
}
}
};
MyObj = {
foo: "bar",
// ...
stuff: function(){
if (this.foo === "bar"){
this.doSomething();
} else {
this.doAnotherThing();
}
},
moreStuff: function(){
var result = "some default";
if (this.baz === "quux" && this.getSomeStuff("foo")){
result = this.otherStuff();
}
return result;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment