Remix - Advanced Patterns
What will be the output of this Remix loader if the URL has no
q parameter?
export async function loader({ request }) {
const url = new URL(request.url);
const q = url.searchParams.get('q') || '';
const items = ['pen', 'pencil', 'paper'];
const filtered = items.filter(item => item.includes(q));
return json({ filtered });
}