How to write a function f(x) or f('x') so that it produces the same output
as a call to alert-function:
var x='abc';
alert('x='+x);
In testing one needs to write similar alert() calls often. By having a
function f(), which would add the variable name in front of the variable
value one would save a lot of typing during one's lifetime.
I think there is so simple solution for this that I probable will feel very
embarrassed after getting the answer. So I blush in advance :).
as a call to alert-function:
var x='abc';
alert('x='+x);
In testing one needs to write similar alert() calls often. By having a
function f(), which would add the variable name in front of the variable
value one would save a lot of typing during one's lifetime.
I think there is so simple solution for this that I probable will feel very
embarrassed after getting the answer. So I blush in advance :).
Comment