Except for convenience, there is no difference. Both methods are valid. Using a parameter (in my opinion) is more readable, especially in advanced functions, where a parameter declaration can contain several lines of code, and you can use indentation and line breaks.
source share