function factorial(n):Number {
if (n < 2) {
return 1;
}
return n*factorial(n-1);
}
trace(factorial(3)); //Outputs 6
Welcome to my actionscript snippet library!
Actionscript Snips is a small repository of actionscript code that aims to save developers and designers time when developing a website.
1 comments:
Post a Comment