Skip to content

Instantly share code, notes, and snippets.

@os0x
os0x / NodeList.prototype.js
Created May 17, 2010 09:39
JavaScript: リストを配列のように扱う(for Chrome5)
(function extend_NodeList(proto){
if(Object.defineProperty){
Object.getOwnPropertyNames(Array.prototype).filter(function(prop){
return typeof Array.prototype[prop] === 'function';
}).forEach(extend_by_array);
}
function extend_by_array(name){
if (name in NodeList.prototype){
return;
}