When you expect a number, you usually need to convert it to an int
or similar for further use. Otherwise you'll be comparing numbers with strings. For example if (3 == "3")
would return false
- which is not what you usually want.
Additionally, you usually want to ensure that if no parameter is found, you will have a default value - othertise you may run into errors.