Closed
Description
Search Terms:
Type Array filter
Code
type T = { id:number };
const obj = [{id:1},{id:2},{id:3}]
const ids = [1,2,5];
const error: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