Your JSON array has an element with no nameand attributes description. This is the element with id "dae04696-2acb-4972-a471-1b873e2a8d4f"at index 322:
{
"fees":[],"variations":[],
"available_for_pickup":true,
"available_online":false,
"visibility":"PUBLIC",
"id":"dae04696-2acb-4972-a471-1b873e2a8d4f",
"type":"NORMAL"
}
Thus, your code will throw an error in the following statement because you are trying to use the String (search) method in the undefined attribute name:
if ((tipuedrop_in.pages[i].name.search(pat) != -1 || ....
, if , , , description.
if ((tipuedrop_in.pages[i].name
&& tipuedrop_in.pages[i].name.search(pat) != -1
|| tipuedrop_in.pages[i].description
&& tipuedrop_in.pages[i].description.search(pat) != -1)
&& c < set.show) {
...
, String ( String(tipuedrop_in.pages[i].name)) , "undefined" (), name .
:
"undefined", "fine", undefined, , , , .