Skip to content

Instantly share code, notes, and snippets.

View dhpradeep's full-sized avatar
🏠
Working from home

Pradip Dhakal dhpradeep

🏠
Working from home
View GitHub Profile
@dhpradeep
dhpradeep / simple-pagination.js
Created August 2, 2020 06:23 — 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;
@dhpradeep
dhpradeep / simple-pagination.js
Created August 2, 2020 06:23 — 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;