In this example the difference is that you have written one more line in the first one.
There are zero advantages out there, and the only reason I see people using it like this is that they do not know what a and for what it serves. Of course, the person's taste may be another reason, but there is no reason.
If I had a more complex expression I would even understand what was done before and save it in a variable with a meaningful name. A name that is not informative or informs the truism does not increase legibility.
If the value was used elsewhere, it has the exact reason for a variable to exist.
Doing something because one day you might need it violates the YAGNI principle, and to a certain extent KISS . Having a good IDE change the expression to a variable if you need is the simplest thing you have.
It's not to save code, it's to simplify the code. It is debatable, but putting the statement / definition of what you will use as close to where it is used usually gives you more readability. Long code is harder to follow. Outside the semantics that if there is a variable is why it should be used in several places. Code is expression, when expressing wrong passes the wrong idea and makes the code convolute.
Depending on the language there is difference in performance and even memory consumption.
Never do anything without knowing why you are doing it. Do not go in the automatic, do not follow rules that others have said is good. Look for what is good for you, but do it with awareness of choice.