required :limit > 0 start = (pageIndex - 1) * limit;end = limit * pageIndex - 1;pageCount = Math.ceil(total/limit);