How to check variable is null or undefined?

To check for null or undefined in TypeScript, use a comparison to check if the value is equal or is not equal to null or undefined.

Check example below:

Related Answers

How to filter numeric value and remove if 1st character is zero?

In below example will see how to filter numeric value (1-9) and remove all unnecessary characters and if 1st character is zero from a string by using regular expression and charAt method.

Related Answers

How to filter numeric value and remove all unnecessary characters?

In below example will see how to filter numeric value (0-9) and remove all unnecessary characters from a string by using regular expression.

Related Answers

How to loop an array of objects and print some key value?

I used the map() method to iterate over the array of object. In objectItems has some array of object items. In below example will see how to map an array of objects and iterate over the array of object and write console log product ID and product Name by using TypeScript or Javascript.

Related Answers

How to filter an array of objects in TypeScript?

I used the filter() method to iterate over the array of object. In objectItems has some array of object items. I have iterate over the array and checked & compaire eventId & productId, if eventId not equal 3 & productId not equal 8 in object objectItems meets those conditions.

Related Answers