You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Should not return error due filter(n => !!n) returns only empty array or array with positive values, like via reduce example.
Actual behavior:
Type '(number | undefined)[]' is not assignable to type 'ValueArrayType'. Type 'number | undefined' is not assignable to type 'number'. Type 'undefined' is not assignable to type 'number'.
TypeScript Version: 4.0.2
Search Terms:
filter(), reduce()
Code
Expected behavior:
Should not return error due filter(n => !!n) returns only empty array or array with positive values, like via reduce example.
Actual behavior:
Playground Link:
https://www.typescriptlang.org/play?#code/C4TwDgpgBAsghiARhAanANgVwgQQE54IAq40AvFPoSADwB2mAtsnlAD5SZ0AmEAZgEs6EbgD4A3AChQkKGiy4CxUlApUE9JiwmTJAYwD2dAM7AojBMnnZ1IAFyxLqDDaUgSsigG0AjABoAJj8AZj9OHn4hEQBdKX0jUygANxdFag8IAH1MgwBrVXMnazSEADo8EUw9CAAKGr1MAjDhAA9gAEpVUSgAb0koAagBPhrWjt7+wamGglKwTGMAC1GINvapKYBfSYGK4Ea6KBm8KU2wr2ioOGM5VNsM9d1DEzMUhXvSbIB5AGlMgIcxQ+nkKSGc7zcVxuQLcGTiAHp4VAAEoQDAgKC-AD8OPiLygEAIBjwGWMtkBd1hKm8Oyg-iCoSgtK4vEEwm4YVpiMxPyxtIY6HQnKm3N+UGABgMfKmPW2l2utwh6VICKRAHVFhjCXhiVioAB3ATARZQQToYCEvnPRJvVzKyDZbXEilK5QgixgmHUUpmi14UZdKAAQiDdE6UiAA
The text was updated successfully, but these errors were encountered: