Yep, to localize a variable, just use the var scope:

function jedisDoItWithTheForce(x,y) {
var theDate = "";
var whatever = 1;

//code
}

2 rules:

Var scope declarations MUST come before any other lines of code. So, they
have to be on top.
You MUST declare a value for the variable, even if you change it later.
Notice how I used a simple empty string for theDate.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to