Extracting Subsets of Array Elements
package{
import flash.display.Sprite;
public class Main extends Sprite{
public function Main(){
var aEmployeesAll:Array = ["A", "P", "C", "H",
"Gilberto", "Mary", "Ayla", "Riad"];
var aEmployeesExec:Array = aEmployeesAll.slice(0, 4);
var aEmployeesNew:Array = aEmployeesAll.slice(4, 6);
var aEmployeesStaff:Array = aEmployeesAll.slice(6);
trace(aEmployeesExe.toString());
trace(aEmployeesNew.toString());
trace(aEmployeesStaff.toString());
}
}
}
A,P,C,H
G,M
A,R
Related examples in the same category