Implement `toNumber(str)` returning the numeric value of `str`, or `null` when it is not a valid number.
Run your code to see results.