Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Why can.Observe.prototype.each() argument order is different from jQuery.each()?

$
0
0
Why did you chose a different argument order - it can be really confusing.

Even the documentation You provide ( http://donejs.com/docs.html#!can.Observe.prototype.each ) is ambiguous in this matter:

The example suggests one order:
new Observe({ foo: 'bar' }) .each( function( value, name ) { equals( name, 'foo' ); equals( value,'bar' ); 
  }); 
and the API section the other:
can.observe.each(handler( attrName, value )) -> can.Observe 

What is the motivation behind this?

Viewing all articles
Browse latest Browse all 3491

Trending Articles