I am new to web development and in my function I want to check if the given string value is a number. If the string is not a valid number, I want to return null.
The following actions are performed for all cases, except when the string is "0", in which case it returns null.
parseInt(columnSortSettings[0]) || null;
How to prevent this. Obviously, parseInt does not consider 0 to be an integer!
javascript typescript
Rahul misra
source share