data hiding - mmedrano9438/peripheral-brain GitHub Wiki

Data hiding is like we have a variable and we want privacy over it so that no other functions or other parts of the code can have access over it is called Data hiding or data privacy. In other words, we are just encapsulating the data so that other parts of the code can't have access to it.

You can hide data by using closure method:

<script> function x() { var a = "GeeksforGeeks"; function y() { console.log(a); } return y; } x()(); </script>

⚠️ **GitHub.com Fallback** ⚠️