I have to cast this:
let selections = list.filter(obj => obj.type === "myType");
I get an error with a filter which says
filter does not exist on type 'NodeType'
I tried to follow these suggestions TypeScript casting arrays
let selections = <NodeType[]>list.filter(obj => obj.type === "myType");
but I still get the same error, I can't see how to fix this. In pure javascript, it works.
Update: thanks to answers below which makes me realize I call the right method when I tested in console and a wrong one in my code editor.
filter does not exist on type 'NodeType'that makes it sound likelistis aNodeType, not an array. How waslistcreated?