I am trying to add parameters to a function in javascript, but it doesnt work somehow.
Can you let me know, how can I add them ?
I have a function like :
var foo = function () {
var a = {
"abc":"value1"
"bcd":"value2"
}
return a;
};
Now, I do this :
alert(data: [foo()]) // Actually I keep it in my function and **it works**
And I can see "abcd" and "bcd" with values.
But, Now I want to add a more variable (which is dynamic), how can I do that
I try this :
data:[foo() + {"cde":"value3"}] //doesnt work
data:[foo().push ({"cde"="value3"})] //doesnt work
How can I add a more variable to this array