Sometimes I could choke someone - if not
everyone - who worked on the creation process of JavaScript!
[...](show me)(don't show me)
I was searching again for a long time to find an error in my code. But even after I (quickly) managed to find the line in err I couldn't understand the wrongness in it. I tried different possibilities, different improbable possibilities but simply could not find an answer. Then - it was only a matter of statistics and time after all - I found the improbable way to alter my code.
Long story short: don't write "If" in your JavaScript code with a capital "I". It may work for most of the time or most of your codes / programs but if you use a certain function, doom is certain. (I surely don't know which - there're probably more than one anyway).
*shiver*
Here's an example of code not working because of "If":
<<
// checks if an object is a string
function Is_String()
{
If ( typeof arguments[0] == "string" ) return true;
else If ( typeof arguments[0] != "object" ) return false;
else return ( arguments[0].constructor.toString().toLowerCase().indexOf( "string" ) != -1 );
}
>> # top # | Q (original code): Planet PDF.com Labels: personal, programming
0 Comments:
Post a Comment