Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
How to show pagination using JS List?

Hello I really need your help I'm new to JAVASCRIPT and I need to implement a pagination alphabetically from a-z I don't know where to start .. I wish I could have a list of first letters found in the result (I mean, if there is no row beginning with 'a', I don't want the 'a' to be display on the pagination links). Is there any kind of plain Javascript pagination exists ?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Lets say you have a list of names instead of rows to paginate. It might be a good idea to group them under their initial character and then set up your pagination accordingly.

 var names = ["aaron", "amber", "bruce", "david", "izzy", "jasmine", "jeniffer", "karen", "lily", "mandy", "marry", "ozzy", "ricky", "sally", "sandy", "tom", "vanesa", "zoe"],
     pages = names.reduce( (ps,n) => ps[n[0].toUpperCase()] ? (ps[n[0].toUpperCase()].push(n), ps)
                                                            : (ps[n[0].toUpperCase()] = [n], ps)
                         , {}
                         );
console.log(pages);

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!