Functions do have local variables.
As long as you’re in a function window you have at bottom of your normal variable window a new one which shows you local variables. They are exactly like any normal variable with exception that they don’t have default values.
Just like in this picture: