You never use this object as an object anywhere, so it would be easier and more efficient to just have var deltaX, deltaY and avoid the object creation on every move event.