Is wrapping code in closure a good habit?

I'm new to Angular, and I just finished the Code School tutorial for new to Angular. Now in the second video, the course instructor says that we are going to turn all of our application code into closure. The video link is below. He says it around 00:30. Now why is it good practice to keep our code closed?

Link to video

+8
javascript angularjs
source share
1 answer

Closures are mainly used to create a private scope and prevent overflow of variables in the global scope.

+16
source share

All Articles