setHistory = function(changes) {
    const obj = this;

    if (obj.ignoreHistory != true) {
        // Increment and get the current history index
        const index = ++obj.historyIndex;

        // Slice the array to discard undone changes
        obj.history = (obj.history = obj.history.slice(0, index + 1));

        // Keep history
        obj.history[index] = changes;
    }
}
Initializes a new history record for undo/redo

@return null