JSFiddle - React, Tailwind, and code Playground

JavaScript

var DepartmentFactory = function(data) {
        this.id = data.Id;
        this.name = data.DepartmentName;
        this.active = data.Active;
    }
    
    var objArray = [];
    objArray.push(new DepartmentFactory({Id: 1, DepartmentName: 'Marketing', Active: true}));
    objArray.push(new DepartmentFactory({Id: 2, DepartmentName: 'Sales', Active: true}));
    objArray.push(new DepartmentFactory({Id: 3, DepartmentName: 'Development', Active: true}));
    objArray.push(new DepartmentFactory({Id: 4, DepartmentName: 'Accounting', Active: true}));

    console.log(objArray.sort(function(a, b) { return a.name > b.name}));