I want to display all values from array categories, but I always got [object object] or undefined. Here is code in last lines if statement, there is that problem in part between bracket [] when I want to call categories and type of categories is Object:
const urlKeys = [...new URL(window.location.href).searchParams.keys()];
let categories = [];
let count = urlKeys.length;
for (let i = 0; i < count - 1; i++) {
categories.push({ type: paramsFromUrl.get('category' + i) })
} //Here I push elements in categories
if (urlKeys[0] === 'allCategories') {
document.getElementById('notice').innerText = "All categories included: [" + categories + "]";
return viewsjs.createRestaurantCards(filterjs.findRestaurantsByCategory(await restaurantsjs.loadRestaurantsJSON(), categories));
} //Here is problem