Skip to content

Instantly share code, notes, and snippets.

@koduki
Created October 18, 2010 23:42
Show Gist options
  • Save koduki/633309 to your computer and use it in GitHub Desktop.
Save koduki/633309 to your computer and use it in GitHub Desktop.
var items = [2,7,1,5,1,2,4,65,76,874,3,2,1,3,7,1,5,1,2,4,65,76,874,3,2,1,3]
var table = []
items.forEach(function(n){
console.log(table);
table = table.concat(table.map(function(x){return x + n}).concat(n))
})
table.filter(function(x){return x <= 10}).sort(function(x,y){return x < y})[0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment