Skip to content

Instantly share code, notes, and snippets.

View ericmorand's full-sized avatar
🏠
Working from home

Eric MORAND ericmorand

🏠
Working from home
View GitHub Profile
@kimamula
kimamula / sort.js
Created October 28, 2017 15:46
JavaScript asynchronous sort
/**
* return the mid value among x, y, and z
* @param x
* @param y
* @param z
* @param compare
* @returns {Promise.<*>}
*/
async function getPivot(x, y, z, compare) {
if (await compare(x, y) < 0) {