Week 3 Day 2
# Week 3 Day 2
What is the purpose of Encapsulation?
What were some of the problems with closures and the underscore prefix?
How do we create private variables in a ES6 Class? Why would you do this?
It is to decrease the complexity of some code, and make sure that one script does just one thing, so if something goes wrong, it is easy to find out what.
It can messup the the underscore prefix convention. Some beginners don't know it exists, and it can cause issues.
You create private variables in an ES6 class by having a proxy setup to run the class through. You do this to make the information harder to access and change.
Daily Challenge
https://github.com/JordanWilker/3-Week-2-Day