4 principles of OOP
Encapsulation:
Ex:
const person = {
firstName: 'Vijay',
lastName: 'Deepak',
getName() {
return `${this.firstName} ${this.lastName}`;
}
};Abstraction:
Ex:
function complexFn(data) {
// complex code & bussiness logics
}
complexFn("hi"); // code of the function is not consideredInheritance:
Polymorphism: ( Many Forms )
Last updated