Code errors this   -> $this in JS delta function