Click here to Skip to main content
16,016,425 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello,

I'm looking for a way to pass an array as a function's arguments.

Does anybody have any ideas to do this?

I want to do that,

I just stored elements in array at server side and i am trying to pass that array to function in java script, but i cant,


Please help
Posted
Updated 1-Mar-12 20:00pm
v2
Comments
Sergey Alexandrovich Kryukov 2-Mar-12 1:42am    
C#, JavaScript or both? Do you realize that C# and JavaScript has nothing to do with each other? One always works on server side, another -- on client side, one never ever calls a method of the other one?
--SA
amolpatil2243 2-Mar-12 1:51am    
it is only for the javascript

Each of these two different languages (please see my comment to the question) allows passing of an argument of any type, including the array.

More exactly, in C# this is the array type, which is a reference type, so pass it by value.

As to JavaScript, you can pass any object and process it in any way, but you should understand that in this language, there are no types (the language type system is "loose-type" and "prototype-based", which is not the type in the usual sense of this word). You just pass any object and process it inside the function body in some assumptions on its structure.

In a few words, you don't have to find any ways. Just pass a parameter, that's it.

—SA
 
Share this answer
 
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900