- From: Brendan Eich <brendan@mozilla.org>
- Date: Tue, 8 Dec 2009 09:37:28 -0800
- To: Robin Berjon <robin@robineko.com>
- Cc: Anne van Kesteren <annevk@opera.com>, public-script-coord@w3.org
On Dec 8, 2009, at 9:17 AM, Robin Berjon wrote: > Admittedly, at some point we should just use an options map. But > some cases seem to still want positional. Could you give some real-world examples? IMHO "idiomatic JS" does not abuse positional parameters to let either or both be optional, requiring programmers to pass null. Trailing parameters in increasing order of optionality are common (this is not really an idiom, or at least not one peculiar to JS); otherwise an object with optional properties is often passed: d.foo({bar: myBar, foo: myFoo}); d.foo({bar: otherBar}); d.foo({foo: someFoo}); /be
Received on Tuesday, 8 December 2009 17:50:47 UTC