Lesson 26 of 50

Object-Oriented Programming

OOP allows you to model real-world entities using objects and classes. It helps organize complex applications.

class User {
  constructor(name, skill){
    this.name = name;
    this.skill = skill;
  }
  greet(){
    console.log("Hello " + this.name);
  }
}
let u = new User("Yusuf", "JS");
u.greet();
← Previous Next →