One thing worth noting is switch statement uses strict equality (===) therefore it's not exactly the same as if/else with equality (==).

Kenneth Kawamoto
http://www.materiaprima.co.uk/

Paul Andrews wrote:
Hi guys

quick question that came up in a conversation I had the other day - are switch statements more or less efficient than a series of if...else statements in either AS2 or AS3?

I'd always thought that the most efficient was the switch

I doubt that there's anything in it - the compiler writes your if statement for you with a switch statement.

It would be better to be more concerned about readability and maintainability, where the switch statement will win hands down for many cases.. ;-)

Paul

al.z
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to