|
Posted by iulian.ilea on 09/15/06 22:36
In JavaScript, if I have func(var1,var2,var3) it is possible to call
func("valueone") or func("valueone","valuetwo"). Ofcourse that value1
and valuetwo ar assigne to var1 and var2. If a third parameter is sent
this is assigned to var3.
Alvaro G. Vicario wrote:
> *** iulian.ilea escribió/wrote (15 Sep 2006 06:56:29 -0700):
> > Me, back again with another question about function:
> > if I have this function me($param1, $param2=null, $param3,
> > $param5=null, $param6=null) how can I found how many parameters are
> > send in function when the function is called?
>
> You cannot do that, not even in JavaScript. There'd be no way to know which
> ones of the provided values match each argument names. From manual:
>
> "Note that when using default arguments, any defaults should be on the
> right side of any non-default arguments; otherwise, things will not work as
> expected."
>
>
>
> --
> -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
> ++ Mi sitio sobre programación web: http://bits.demogracia.com
> +- Mi web de humor con rayos UVA: http://www.demogracia.com
> --
[Back to original message]
|