@Jack Turner: I like attaching it to the object as it's clear at the bottom of the function what I'm doing. If I have more than a couple functions then I have to scroll up to see where the object literal starts. And it more closely matched the second example, which again makes it clear to me what it is I'm attaching before returning the object. But this is purely preference.
↧