OrbitControls Damping Does not work for me

I tried to use damping in my code but it is not working. So I tried this example. It works through Three.JS website however when I copy the source code in my editor (VS 2017) and run it, everything is fine but damping!
I tried “TrackballControls” which is working perfectly. But this control does not have any property to limit the Polar Angle. Any solution for these issues?

Do you call OrbitControls.update() in your animation loop? This is required when OrbitControls.enableDamping is set to true.

Of course yes. As I said, I copied the exact code that was written by mrdoob in my IDE (VS 2017) and run it. All functionalities of OrbitControls is working except damping.

Sry, no idea why this happens. The damping implementation is simple math so I can’t explain myself why it does not work in your IDE preview.