Defaulting parameters to previous arguments

P T Withington ptw at pobox.com
Tue Jul 29 06:04:56 PDT 2008


Will es4 let me say this?

   function select (start:Number, end:Number=start) { ... }

or do I have to resort to something like:

   function select (start:Number, end:Numer=null) {
     if (end == null) { end = start; }
     ...
   }



More information about the Es4-discuss mailing list