- Published on
TypeScript! Difference between public,private,readonly.
- Authors
- Name
- Ridha Majid
Public : it's like a Global scope , you could call it outside a function/class
Private : it's like a function scope/class. variable/state only available inside the scope you can’t call it outside the scope.
Readonly : You can call it inside/outside the scope, however you can’t edit/change it.