delete the statistic function javascript