First off, I've really enjoyed using the Prototype framework. It's
really well done. Kudos to all the programmers involved.
Now, here's what I'm posting about...
I've come across a function for Arrays that I've found rather useful,
and I think others would as well; Array.compare().
Array.prototype.compare = function(a) {
var length = a.length;
if (this.length !== a.length) return false;
for (var i = 0; i < length; ++i) {
if (this[i].compare) {
if (!this[i].compare(a[i])) return false;
else continue;
}
if (this[i] !== a[i]) return false;
}
return true;
}
I think many people would benefit if you included a function similar
to this in your API.
Now, I had a second thing I wanted to ask about. The API uses the
function Object.extend, and I'm curious why you chose not to make this
function a prototype of Object. Currently you use it like this:
Object.extend(someobj, { ... });
I would think it would be better to format it like this:
somobj.extend({ ... });
Simply curious why one way was chosen over the other. I don't really
have a preference, I'd do it either way; was merely curious.
- Kickboy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype: Core" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-core?hl=en
-~----------~----~----~----~------~----~------~--~---