How can I check if a variable is a number?

I'm trying this:

```
set a to 5
if a is a number
display dialog "Yes! It's a number!"
end if

```

I've also tried this code:

```
set a to 5
if a is integer
display dialog "Yes! It's a number!"
end if

```

But unfortunately it doesn't work as expected.