code: function(current, currentStart, currentEnd,
                                  old, oldStart, oldEnd) {
        // "Deletion" columns
        var rowCount = oldEnd - oldStart + 1;
        var columnCount = currentEnd - currentStart + 1;
        var distances = new Array(rowCount);
  
        // "Addition" rows. Initialize null column.
        for (var i = 0; i < rowCount; i++) {
          distances[i] = new Array(columnCount);
          distances[i][0] = i;
        }
  
        // Initialize null row
        for (var j = 0; j < columnCount; j++)
          distances[0][j] = j;
  
        for (var i = 1; i < rowCount; i++) {
          for (var j = 1; j < columnCount; j++) {
            if (this.equals(current[currentStart + j - 1], old[oldStart + i - 1]))
              distances[i][j] = distances[i - 1][j - 1];
            else {
              var north = distances[i - 1][j] + 1;
              var west = distances[i][j - 1] + 1;
              distances[i][j] = north < west ? north : west;
            }
          }
        }
  
        return distances;
      }
docs: Note: This function is *based* on the computation of the Levenshtein "edit" distance. The one change is that "updates" are treated as two edits - not one. With Array splices, an update is really a delete followed by an add. By retaining this, we optimize for "keeping" the maximum array items in the original array. For example:  'xxxx123' -> '123yyyy'  With 1-edit updates, the shortest path would be just to update all seven characters. With 2-edit updates, we delete 4, leave 3, and add 4. This leaves the substring '123' intact.