UNPKG

quxapp

Version:

Qux App is a lightweight module that contains many functions for array operations, sequences, and statistics. Qux App makes writing JavaScript easier and quicker every day!

9 lines (8 loc) 218 B
function median(data) { if (data.length % 2) { return data[Math.floor(data.length/2)] } else { return (data[Math.floor(data.length/2) - 1] + data[Math.floor(data.length/2)])/2 } } module.exports = median