Do I need to pass empty parameters to a javascript function? Do I need to pass empty parameters to a javascript function? javascript javascript

Do I need to pass empty parameters to a javascript function?


It is okay to only pass the first parameter as all other will not be set.If you want to set the 1st and 3rd argument, you will need to make the 2nd null, like so:

form_senden("a",null,"b");


form_senden("abc"); is ok

the other parameters will be initialized as undefined


you may do just form_senden("abc"); putting default values in the function definition.

    function form_senden( form_name, cnf , confirm_txt , trigger_field , ,do_check , chknfcs, allow, errorMsg  ){if(typeof(cnf)==='undefined') cnf = '';if(typeof(confirm_txt)==='undefined') confirm_txt = ''; ...and so on// do something }