
Building URLs with query parameters is something you'll do constantly when working with APIs. Let's build a utility function that handles all the edge cases.
buildQueryString(params) that takes an object?Object.entries() to iterate over the objectencodeURIComponent() for proper URL encodingnull or undefined values{ name: "Alice", age: 25 } → "?name=Alice&age=25"Submit your code to see test results