My function is sorting a Array by age, but its not working for some reason?
Other code so you know what im calling, array name etc.
var employeeA = new Array();
var employee = new Object();
var employeeList = [];
var employeeListA = [];
var name;
var age;
var position;
var type = 3;
var canvas;
var ctx;
function setupCanvas() {
    //alert("1");
    canvas = document.getElementById("employeeRecords");
    if (canvas.getContext) {
        ctx = canvas.getContext('2d');
        ctx.fillStyle = "lightblue";
        ctx.rect(0, 0, 500, 500);
        ctx.fill();
    }
Heres the Sort Age code:
function sortAge() {
    type = 1;
    employeeList.forEach(function(empl) {
        name = empl.name;
        age = empl.age;
        position = empl.position;
        employeeA = new Array(age, name, position);
        employeeListA.push(employeeA);
    });
    var y = employeeListA.length;
    if (y > 1) {
        employeeListA.sort();
    }
}
this code is being called for the sorting buttons
function arrayButtons() {
    employeeListA = [];
    if (type === 0) {
        sortName();
    } else {
        if (type === 1) {
            sortAge();
        } else {
            employeeList.forEach(function(empl) {
                name = empl.name;
                age = empl.age;
                position = empl.position;
                employeeA = new Array(name, age, position);
                employeeListA.push(employeeA);
            });
Thanks for the help! Appreciate it :D
 
     
     
    