Create several homogeneous arrays from a larger heterogenous array efficiently
Ideally, you would want a groupBy function, such as the _.groupBy() function offered by lodash.  If you don't want to load a library, it's not too hard to reimplement groupBy.

This solution also has the advantage of returning the result as one associative array rather than mutating four global variables as a side-effect.



let aircraft = [
    {
        tail: "9736968",
        status: "DRAFT"
    },
    {
        tail: "5114419",
        status: "SERVICEABLE"
    },
    {
        tail: "8395671",
        status: "OUTOFSERVICE"
    },
    {
        tail: "332273",
        status: "SERVICEABLE"
    },
    {
        tail: "6123961",
        status: "UNSERVICEABLE"
    },
];

// http://stackoverflow.com/a/34890276
function groupBy(collection, attr) {
    return collection.reduce(function(result, item) {
        (result[item[attr]] = result[item[attr]] || []).push(item);
        return result;
    }, {});
}

let aircraftByStatus = groupBy(aircraft, 'status');
console.log(aircraftByStatus);