The post title “Test whether variable is a number” looks like a trivial question,
but let’s dig deeper and try to cover all edge cases.
I will split it into two problems and will cover them separately. isNumber First I’ll start with the simple problem.
You have variable that may or may not be a number.
Write a function that will return if it is in fact ‘number’ or otherwise. Here I only need to check the type of given variable.
In this situation I have two edge cases. The first one is…