ruby.js
You’ve got to be kidding. Florian Gross just dropped a huge hunk of JavaScript on the Ruby list. Not only does it add a majority of Ruby’s primitive methods to JavaScript, but it also implements and mixes in Enumerable. Holy cats!!
Object.prototype.extend = function(other) {
if (!this.mixins) this.mixins = []
this.mixins.push(other)
for (var property in other)
if (!this.hasOwnProperty(property))
this[property] = other[property]
}
Iterate like this:
[1, 2, 3].each( function( item ) {
alert( item );
} );
