Percentile
A simple percentile function for JavaScript (or TypeScript) with linear interpolation, taking O(1) time. This is basically an implementation of the C = 1 algorithm here—the same one used by Excel via the PERCENTILE or PERCENTILE.INC formula functions.
Example
; ;// 300 ;// 450 -- interpolated ;// 600