Search Terms:
Type Array filter
Code
typeT={id:number};constobj=[{id:1},{id:2},{id:3}]constids=[1,2,5];consterror:T[]=ids.map(id=>obj[id] ? obj[id] : false).filter(Boolean);Expected behavior:
const error should be T[] only;
Actual behavior:
// error type is T | false
Related Issues:
7657
Search Terms:
Type Array filter
Code
Expected behavior:
const errorshould be T[] only;Actual behavior:
// error type is T | false
Related Issues:
7657