amelioration javascript