javascript-patterns
javascript-patterns copied to clipboard
New method declaration convention
I've come up with a really good convention for naming methods:
person.getData = function person_getData() {
};
We prepend with person_ so that the function name is unique from the identifier, avoiding errors in IE.
It also tells us EXACTLY what function we're dealing with in a stack trace.
@shichuan probably best to let you update the codebase with this new convention; if you approve. For a javascript error dashboard this will prove rather useful