I need to call a js-function with many parameters. Assume,
function Create()
{
var a = $("#a").val();
var b = $("#b").val();
var c = $("#c").val();
var d = $("#d").val();
var e = $("#e").val();
var f = $("#f").val();
var arraydata = [a, b, c, d, e, f];
//: 1. calling js-function with direct parameters
var IsError = Validate_param(a, b, c, d, e, f);
//: 2. calling js-function with array
var IsError = Validate_array(arraydata);
if (IsError == 0)
{
//: Do some operations...
}
}
The validation js-function's are,
function Validate_param(a, b, c, d, e, f)
{
alert("The value of a : "+ a);
}
function Validate_array(arraydata)
{
alert("The value of a : "+ arraydata[0]);
}
My doubt is which is best way to call a js-function with many parameters.
Here, i wrote 2 js-functions for validations. Which function will give better performance, Validate_param() or Validate_array() ?
Thanks in advance..