Skip to main content

Practice ยท 3 of 3

Query Builder

Write buildQuery(base, params) that RETURNS the full URL string: base plus a query string built from the params object using URLSearchParams rules โ€” skip keys whose value is undefined or null, stringify numbers, and encode special characters (spaces become + or %20). With no surviving params, return base unchanged.

Difficulty: intermediate

Back to lesson: Practice: fetch & Pagination โ€” Practice