Is it possible to add a method to an array() in javascript? (I know about prototypes, but I don\'t want to add a method to every array, just one in particular).
The
Arrays are objects, and can therefore hold properties such as methods:
var arr = []; arr.methodName = function() { alert("Array method."); }