Trying to implement this:
let selections = list.filter(obj => obj.type === "myType");
An issue arises with the filter function displaying an error message which states
'filter' does not exist on type 'NodeType'
I attempted to incorporate recommendations from TypeScript casting arrays
let selections = <NodeType[]>list.filter(obj => obj.type === "myType");
However, the same error persists and I am unable to identify a solution. Interestingly, it works fine in pure JavaScript.
Update: Credit to the responses below that helped me realize I used the correct method in the console but mistakenly applied a different one in my code editor.