In reading about the JavaScript namespacing or module patterns, I
often see a step taken to avoid overwriting an existing object. For
instance, at Eric Miragla's description of the module pattern (http://
www.yuiblog.com/blog/2007/06/12/module-pattern/), he mentions that the
YAHOO.namespace()
carefully
On Jun 20, 2:26 pm, Sidney San Martín s...@sidneysm.com wrote:
To an extent, I agree… but how would you write a function like jQuery.ajax,
which takes upwards of 30 optional parameters, in a more JavaScripty way?
On Mon, Jun 20, 2011 at 2:07 PM, Jason Mulligan
to elaborate, there's no reason why a parameter can't be an object
containing optional parameters.
On Jun 20, 2:26 pm, Sidney San Martín s...@sidneysm.com wrote:
To an extent, I agree… but how would you write a function like jQuery.ajax,
which takes upwards of 30 optional parameters, in a more
Not exactly. You'd replace `foo` with the `argment()`ed version, and then
this:
foo({ a: 'one', c: 'three' });
become equivalent to calling the original like this:
foo('one', undefined, 'three');
It's just a wrapper to make writing functions which take options easier. So
instead of
On Jun 21, 4:07 am, Jason Mulligan attac...@gmail.com wrote:
Considering the language, sending an object of args is going against
the convention of JavaScript due to laziness.
You've lost me. Are you saying passing an object is lazy?
--
Rob
--
To view archived discussions from the original