Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #31543

Re: How to have multiple and undetermined number of arguments for function?

Newsgroups comp.lang.javascript
Date 2016-10-09 12:10 -0700
References <c8d1b70e-031e-4b10-a454-afee5d0c9590@googlegroups.com> <f695cf44-131c-4eb8-9169-9b1406abadc1@googlegroups.com>
Message-ID <00102670-1f70-4c19-9e90-8c010dd7a211@googlegroups.com> (permalink)
Subject Re: How to have multiple and undetermined number of arguments for function?
From justaguy <lichunshen84@gmail.com>

Show all headers | View raw


Grammar correction.
"it's very limited" -> "it's very limiting" (better English)

On Sunday, October 9, 2016 at 2:20:05 PM UTC-4, justaguy wrote:
> Update:
> 
> First, currently I'm doing dynamic Table's TD(s) insertion.
> generic function such as addSectionFunction('arg1','argu2') or
> addSectionFunction('arg1','argu2','argu3') can work, however,
> it's very limited. For instance, for the test case, I used INPUT and SIZE=15 for each of these arguments, well, in real world, I may need some of them to be INPUT and some of them checkbox or even date for HTML5 and even for the same INPUT type, some with SIZE of 15 while a few may need to be 60 something.  This type of function and its argument call would not suffice to solve problem at hand.
> 
> Possible solution?
> 
> Thanks.
> 
> On Saturday, October 8, 2016 at 5:48:35 PM UTC-4, justaguy wrote:
> > Hi,
> > 
> > Could we create a generic function like the following?
> > Genf = function () {
> > // do stuff below
> > 
> > };
> > 
> > Then, call this function like
> > Genf (arg1)
> > Or
> > Genf (arg1,arg2)
> > ...
> > 
> > And if it'still doable, do we habe something like arguments.length?  So that we  an loop through for each argument.
> > 
> > Thanks.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-08 14:48 -0700
  Re: How to have multiple and undetermined number of arguments for function? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-10-09 00:07 +0200
    Re: How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-08 16:03 -0700
      Re: How to have multiple and undetermined number of arguments for function? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-10-09 09:59 +0200
  Re: How to have multiple and undetermined number of arguments for function? John Harris <niam@jghnorth.org.uk.invalid> - 2016-10-09 15:35 +0100
    Re: How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-09 11:22 -0700
      Re: How to have multiple and undetermined number of arguments for function? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-10-09 20:09 +0100
        Re: How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-09 13:32 -0700
          Re: How to have multiple and undetermined number of arguments for function? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-10-09 23:26 +0200
            Re: How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-09 15:18 -0700
              Re: How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-10 07:57 -0700
                Re: How to have multiple and undetermined number of arguments for function? Jake Jarvis <pig_in_shoes@yahoo.com> - 2016-10-10 17:26 +0200
                Re: How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-10 08:50 -0700
                Re: How to have multiple and undetermined number of arguments for function? Jake Jarvis <pig_in_shoes@yahoo.com> - 2016-10-10 18:53 +0200
                Re: How to have multiple and undetermined number of arguments for function? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-10-10 18:22 +0100
                Re: How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-10 11:20 -0700
                Re: How to have multiple and undetermined number of arguments for function? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-10-10 17:28 +0100
  Re: How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-09 11:20 -0700
    Re: How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-09 12:10 -0700
  Re: How to have multiple and undetermined number of arguments for function? justaguy <lichunshen84@gmail.com> - 2016-10-10 17:05 -0700

csiph-web