Write a TypeScript function called parseNumber that takes a parameter of type unknown and returns a number if the input is a valid number. If the input is not a number, the function must return NaN.
Never and unknown
Parse number with unknown
Report a typo
Sample Input 1:
Sample Output 1:
NaN
5Write a program in TypeScript
// write your code here
function parseNumber() {
}
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.