I've been slowly learning JavaScript over the last few months, and just got bit by something that I think is a mistaken design. I bet it's bit everyone for whom it's not their first Algol-like language.
I could see it was undefined in Firebug. When the page loads it's not not undefined. I click on it, and boom it loses its definition. How could that be.
Search on Google. Aha. The weirdness. You can call a function with fewer parameters than it defines. The unspecified parameters are (ta dahh) undefined.
|