Krueger
Krueger

Reputation: 1228

Javascript function argument in array

I have:

String.prototype.callcm = function(something[]){
alert(something);
};

"something".callcm({a:50,b:60});

how can the arguments with there variable name get in the something array.

Upvotes: 1

Views: 98

Answers (1)

Selvakumar Arumugam
Selvakumar Arumugam

Reputation: 79850

I think you are asking for a way to pass the values {a:50,b:60} to the function.. then you just need to fix the syntax.

Change function(something[])

to function(something)

jsFiddle here

Upvotes: 1

Related Questions