Skip to content

Instantly share code, notes, and snippets.

@chrislewis
Created September 8, 2009 20:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrislewis/183209 to your computer and use it in GitHub Desktop.
Save chrislewis/183209 to your computer and use it in GitHub Desktop.
Array.prototype.toList = function() {
var list = new Element("ul")
$A(this).each(function(e) { list.appendChild(new Element("li").update(e)) } )
return list
}
document.body.appendChild([1,2,3].toList())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment