Private variables - Little question to Javascript/C#

Hello,

I have a little question to Javascript/c#

I declared many variables, but now I want to change it, so that I only declare variables inside the functions.

When I use "var test" inside a function, is it automaticle private, or do I need to add private?

Second question:

What has more performance: Function 1 needs variable username, and function 2 is sending the username as rpc.

Is it faster when I declare variable for whole script (so that Function 1 and 2 can access it directly). Or is it better do declare the variable inside function 1 and give it with parameter to function two?

Thanks

1) You can't declare local variables private (they're not accessible outside of the function)

2) Doesn't make much difference, but passing as parameter is usually a lot nicer for many reasons (especially if you ever get into multithreading)