Skip to content

a bug about the translate context

y00的弹幕世界 edited this page Nov 14, 2019 · 2 revisions

the link about this

Prefilter JSON
如果我们不想把所有从JSON API中得到的图片都展现出来,我们可以在遍历之前做一次过滤。

我们把其中 "id" 键的值为1的图片过滤掉。

代码如下:

json = json.filter(function(val) {
  return (val.id !== 1);
});

THE statement:

return(val.id!==1);

should be

return(val.id!=1);

Clone this wiki locally