Number vs. String
Question: Is there a way to test whether a particular variable holds a number or a string?
Answer: Yes. To test whether the variable holds a number or a string, use the
operator. If your variable holds a number,
. If it holds a string,
. The following are examples of
operator can also help you distinguish between other data types. Depending on the particular variable's value, the result of
can be one of the following: