Javascript: Skip an element array and make a new array
var newArray = array.reduce(function(result, hoge) { if (some condition) { result.push(hoge); } return result; }, []);
or
var newArray = array.filter(function(hoge) { if (some condition) { return hoge; } });