Skip to content

Instantly share code, notes, and snippets.

@robsilva
robsilva / simple-pagination.js
Created July 16, 2018 19:22 — forked from kottenator/simple-pagination.js
Simple pagination algorithm
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;