LoginSignup
5
1

More than 3 years have passed since last update.

Uncaught TypeError: OO.filter is not a function

Last updated at Posted at 2019-09-09
var apiYokoName = apiMetaYokoList[0].CLASS.filter(function(item, index){
 if (item['@code'] == valueData[key]['@time']){
   return true;
 }
});
//TypeError: apiMetaYokoList[0].CLASS.filter is not a function  

修正

var apiYokoName = [apiMetaYokoList[0].CLASS].filter(function(item, index){
 if (item['@code'] == valueData[key]['@time']){
   return true;
 }
});

filterは配列のメソッドなのにCLASSというオブジェクトで使おうとしたからエラーが出た。

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1