Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢

Brian Leishman BrianLeishman

🐢
  • Stumpyinc
  • Orlando
View GitHub Profile
@kottenator
kottenator / simple-pagination.js
Created Jul 13, 2015
Simple pagination algorithm
View simple-pagination.js
// Implementation in ES6
function pagination(c, m) {
var current = c,
last = m,
delta = 2,
left = current - delta,
right = current + delta + 1,
range = [],
rangeWithDots = [],
l;