On 16/10/2007, Peter Hall <[EMAIL PROTECTED]> wrote: > already you can do something like this: > > var str; > switch(true){ > case /a/.test(str): > alert('a'); > break; > case /b/.test(str): > alert('b'); > break; > }
I can only imagine that solution being preferable to chained if..else-statements in one case, and that would be if you actually used the fall through mechanism. If you don't fall through, it's just bloat without any gain. -- David "liorean" Andersson _______________________________________________ Es4-discuss mailing list Es4-discuss@mozilla.org https://mail.mozilla.org/listinfo/es4-discuss