Is there a JS equivalent of this Ruby?
a=[1, 2, 3, 4]
a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
http://www.ruby-doc.org/core-2.1.2/Array.html#method-i-combination
Is there a JS equivalent of this Ruby?
a=[1, 2, 3, 4]
a.combination(3).to_a #=> [[1,2,3],[1,2,4],[1,3,4],[2,3,4]]
http://www.ruby-doc.org/core-2.1.2/Array.html#method-i-combination