All Challenges

Infinite Scroll / Pagination List

JavaScriptMediumMeeshoMyntraLinkedIn
45:00

Problem Brief

Render a 24-item product feed paginated in chunks of 6 items with Load More batching, live count indicator, and end-of-list button disable state.

Requirements

  • Render the initial 6 `.feed-item` rows inside `[data-testid="feed-list"]` (24 items total).
  • Clicking `[data-testid="load-more"]` appends the next 6 items until all 24 are visible.
  • Update `[data-testid="count-status"]` cleanly (`Showing 6 of 24`, `Showing 12 of 24`, etc.).
  • Disable `[data-testid="load-more"]` once all 24 items are loaded.
Progressive Hints (2)
  • Track `visibleCount = 6` and slice `ITEMS.slice(0, visibleCount)`.
  • Clamp `visibleCount = Math.min(ITEMS.length, visibleCount + 6)`.
Reference Solution

Stuck? Load the verified reference code into your editor.

Automated Test Suite

5 Test Cases Ready
  • Renders initial batch of 6 itemsShows 6 .feed-item rows on initial render
  • Load More appends next 6 items (12 total)Clicking load-more grows rendered count to 12
  • Load More button stays enabled before reaching endButton remains clickable while more batches exist
  • Disables Load More once all 24 items loadReaching 24 items disables button cleanly
  • Items render sequentially without duplicatesContains Product #1 through Product #12 after one batch click
solution.html
Live Sandboxed Previewiframe sandbox
Starter template loaded — add your <script> logic in the editor (or open Reference Solution) to make the widget interactive.