So, I admit that I am new to javascript and that I came from C. + background ("Hello, I am Bob, I am a class-based static user", chorus of "Hello, Bob!".).
I find that I often get features like:
function someFunc()
{
if (arguments.length === 0 ){
...
} else {
...
}
}
(where there may be three such cases). Or else, I write the difference in the name:
function someFuncDefault() { ... };
function someFuncRealArg(theArg) { ... };
(Replace โRealArgโ for some semantically-filled phrase).
Is there a better sample for this kind of thing?
Afton source
share