Created
January 14, 2016 10:33
-
-
Save peysal/acf150dc3b9c42d2729b to your computer and use it in GitHub Desktop.
Bonfire: Where do I belong
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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