CoreMedia CKEditor 5 Plugins
    Preparing search index...
    • Method to compare two prioritized objects to sort them by ascending priority (thus descending number). Note that the sort order adapts the number representation for high and low priorities as defined by CKEditor's PriorityString.

      Parameters

      Returns number

      const objs: Prioritized[] = [
      {priority: -2},
      {priority: 2},
      {priority: -1},
      {priority: 1},
      {priority: 0},
      ];

      objs.sort(byPriority);
      // [2, 1, 0, -1, -2]