TypeScript filter out nulls from an array

Posted by Pinki | Updated on

TypeScript filter out nulls from an array You can use a type predicate function in the .filter to avoid opting out of strict type checking:

Alternatively you can use array.reduce(…).


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers