function createIRect(a) {
  if (a) {
    return {left: a[0], top: a[1], width: a[2] - a[0], height: a[3] - a[1]};
  }
  return null;
}
Create a rect like object.
@param {Array<number>} a Array of numbers with given coordinates for rect,
    with expected order [x1, y1, x2, y2].
@return {?{left: number, top: number, width: number, height: number}} A rect
    like object.