Possible Duplicate:
Inspect the names/values of arguments in the definition/execution of a JavaScript function
When debugging javascript, I often have code like this:
function doSomething(a,b,c) {
console.log(a,b,c);
//function contents here
//...
}
This results in a line in the console like this:
0.0010719847172334315 0.002392010391772366 -2.764548758273147e-7
Which is hard to read. I want to have output like this:
a: 0.0010719847172334315, b: 0.002392010391772366, c: -2.764548758273147e-7
Is this possible to do? I don't think it is possible to do in many languages. However, I don't know javascript very well, and it seems like a language where it is possible to do clever things like this.