Skip to content

Instantly share code, notes, and snippets.

View parfaitebobissepro's full-sized avatar

Parfait Ebobisse Epoune parfaitebobissepro

View GitHub Profile
@parfaitebobissepro
parfaitebobissepro / simple-pagination.js
Created December 30, 2022 13:19 — 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;