最佳答案
JavaScript 和 Ruby 有类似的功能吗?
array.select {|x| x > 3}
比如:
array.select(function(x) { if (x > 3) return true})