with regard to if(someCondition) return;, i’m unclear on basic usage and best practices.
in the following, if any of the if conditions are true the function is terminated… makes sense. and i guess they’re still read in ascending order.
public function indexFunc(index:Number):Void
{
if (index < 0 ) return;
if (index >= 10 ) return;
if (index == currentIndex) return;
trace("Okay, now do something.");
}
is this proper shorthand? a good practice? the reason i ask is that i can’t find this use of return in the flash8 documentation… it only details using return to specify a value returned by a function; never a mention of using it to terminate a function.
i’m new to custom classes and coding in general…
thanks for your help.