1 function d3_raphael_type_selector(type, d3_paper, first) { 2 var found = []; 3 4 d3_paper.forEach(function(el) { 5 if(el.type === type) { 6 found.push(el); 7 8 return !first; // break forEach for first only requests 9 } 10 }) 11 12 return found; 13 };