Javascript 筛选列表会崩溃而不会引发错误
我有这段谷歌应用脚本代码,用于获取一些YT频道,并过滤其中一些频道: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
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)));