I have been setting multiple variables like this
function doSomething() {
var FirstName = $FirstName.data("ov");
var LastName = $LastName.data("ov");
var Company = $Company.data("ov");
var Website = $Website.data("ov");
}
I just read some reviewed code and both reviewers advised setting the variables in a single statement, like this:
function doSomething() {
var FirstName = $FirstName.data("ov"),
LastName = $LastName.data("ov"),
Company = $Company.data("ov"),
Website = $Website.data("ov");
}
What would be the advantage of doing it the second way? Is there a performance benefit? Is it that there is less code?