Outlier dection in Javascript