Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/asp.net-mvc-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 筛选列表会崩溃而不会引发错误_Javascript_Google Apps Script_Youtube Api_Filtering - Fatal编程技术网

Javascript 筛选列表会崩溃而不会引发错误

Javascript 筛选列表会崩溃而不会引发错误,javascript,google-apps-script,youtube-api,filtering,Javascript,Google Apps Script,Youtube Api,Filtering,我有这段谷歌应用脚本代码,用于获取一些YT频道,并过滤其中一些频道: var popularChannels = YouTube.Channels.list('id, snippet, statistics', { id: resultsParentChannelIds.slice(i * 50, (i + 1) * 50) }).getItems(). filter( ch => ((channelIdFilter == &q

我有这段谷歌应用脚本代码,用于获取一些YT频道,并过滤其中一些频道:

    var popularChannels = YouTube.Channels.list('id, snippet, statistics', {
        id: resultsParentChannelIds.slice(i * 50, (i + 1) * 50)
    }).getItems().
    filter(
      ch => 
    ((channelIdFilter == "" || ch.id == channelIdFilter)
    && (subCountFilter == "" || ch.statistics.subscriberCount > subCountFilter)
    && (channelLocationFilter == "" || channel.snippet.country == undefined || channel.snippet.country == channelLocationFilter)
    && (channelNegativeLocationFilter == "" || channel.snippet.country == undefined || channel.snippet.country != channelNegativeLocationFilter)));
除最后一个负位置过滤器外,所有过滤器都是

但是调试器在第一个过滤器之后停止,并且没有写入任何错误

我如何调试或了解问题所在


您将currentValue变量从
ch
更改为
channel

var popularChannels = YouTube.Channels.list('id, snippet, statistics', {
  id: resultsParentChannelIds.slice(i * 50, (i + 1) * 50)
}).getItems().
filter(
ch => 
((channelIdFilter == "" || ch.id == channelIdFilter)
&& (subCountFilter == "" || ch.statistics.subscriberCount > subCountFilter)
&& (channelLocationFilter == "" || ch.snippet.country == undefined || ch.snippet.country == channelLocationFilter)
&& (channelNegativeLocationFilter == "" || ch.snippet.country == undefined || ch.snippet.country != channelNegativeLocationFilter)));