Is there a solution I can use that allows me to define more than one var with the same value in a single step at the start of my funcion?
function myFunction () {
var a,b = 0;
document.write(a) // undefined
document.write(b) // 0
}
Is there an improved way to write a,b = 0; ?
Something like this, however I don’t like it.
Better
Please take a look at http://javascript.crockford.com/code.html