Skip to content

Instantly share code, notes, and snippets.

@peysal
Created January 14, 2016 10:33
Show Gist options
  • Save peysal/acf150dc3b9c42d2729b to your computer and use it in GitHub Desktop.
Save peysal/acf150dc3b9c42d2729b to your computer and use it in GitHub Desktop.
Bonfire: Where do I belong
function where(arr, num) {
// Find my place in this sorted array.
var sortedAsc = arr.sort(function(before, after){
return before - after;
});
console.log('| sortedAsc:' + sortedAsc);
var position = sortedAsc.reduce(function(before, after){
return "ayam";
});
console.log('| ayam:' + position);
return num;
}
where([40, 60], 50);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment