{"id":18822234,"url":"https://github.com/rupomsoft/javascript-oop-tutorial-with-example","last_synced_at":"2026-04-07T04:31:35.275Z","repository":{"id":176435955,"uuid":"656638543","full_name":"rupomsoft/JavaScript-OOP-Tutorial-With-Example","owner":"rupomsoft","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-21T11:12:46.000Z","size":11,"stargazers_count":16,"open_issues_count":0,"forks_count":16,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T14:14:08.968Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rupomsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-21T10:40:12.000Z","updated_at":"2024-12-25T11:55:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"94794d97-b9a3-4374-9005-50706cc1d48c","html_url":"https://github.com/rupomsoft/JavaScript-OOP-Tutorial-With-Example","commit_stats":null,"previous_names":["rupomsoft/javascript-oop-tutorial-with-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rupomsoft/JavaScript-OOP-Tutorial-With-Example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupomsoft%2FJavaScript-OOP-Tutorial-With-Example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupomsoft%2FJavaScript-OOP-Tutorial-With-Example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupomsoft%2FJavaScript-OOP-Tutorial-With-Example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupomsoft%2FJavaScript-OOP-Tutorial-With-Example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rupomsoft","download_url":"https://codeload.github.com/rupomsoft/JavaScript-OOP-Tutorial-With-Example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rupomsoft%2FJavaScript-OOP-Tutorial-With-Example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31500397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T03:10:19.677Z","status":"ssl_error","status_checked_at":"2026-04-07T03:10:13.982Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T00:48:35.334Z","updated_at":"2026-04-07T04:31:35.255Z","avatar_url":"https://github.com/rupomsoft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JavaScript Object Oriented Programming Complete Note\n\n#### 1. JavaScript Object\nAn Object is a unique entity that contains properties like.\n- Variable type properties\n- Methods properties\n- Object properties\n- Array properties\n- And more....\n\n```sh\nlet person = {\n    //Properties\n    first_name: 'Jhon',\n    last_name: 'Dee',\n    //method\n    getName:()=\u003e {\n        return (`The name of the person is ${person.first_name} ${person.last_name}`)\n    }\n}\nconsole.log(person.getName());\n```\n\n#### 2. Class \u0026 Object\nClasses are blueprints of an Object\n- A class can have many Objects because\n- Class is a template while Objects are instances of the class\n- Using let or var to declare variables inside a class is unnecessary because class\nproperties are automatically scoped to the class instance and don't require explicit\nvariable declarations\n\n```sh\nclass Person {\n    //Properties\n    first_name='Jhon'\n    last_name='Dee'\n    \n    //method\n    getName() {\n        return (`The name of the person is ${this.first_name} ${this.last_name}`)\n    }\n}\nconst person1 = new Person();\nconsole.log(person1.getName());\n```\n\n#### 3. Constructor\nClass constructor is a magic method\n- Constructor execute automatically when object is created\n- Constructor can take parameter\n- Constructor method can't return any result\n\n```sh\nclass Person {\n    constructor() {\n        console.log('I am a constructor')\n    }\n}\nconst person1 = new Person();\n```\n```sh\nclass Person {\n    constructor(msg) {\n        console.log(msg)\n    }\n}\nconst person1 = new Person('I am a constructor');\n```\n\n\n#### 4. Static Keyword\nClass constructor is a magic method\n- The static keyword is used to define a static method or property of a class.\n- To call the static method we do not need to create an instance or object of the class.\n- We create a static variable in JavaScript to prevent replication\n- Fixed configuration, and it is also useful for caches\n\n```sh\nclass Person {\n    //Properties\n    static first_name='Jhon'\n    static last_name='Dee'\n    //method\n    static getName() {\n        return (`The name of the person is ${this.first_name} ${this.last_name}`)\n    }\n}\nconsole.log(Person.getName());\n```\n\n\n#### 5. Inheritance\n- Keyword \"extends\" is used to create inherit relationship between class\n- For inherit relationship child class can use parent class properties\n```sh\nclass Father {\n    //Properties\n     first_name='Jhon'\n     last_name='Dee'\n    //method\n     getName() {\n        return (`The name of the person is ${this.first_name} ${this.last_name}`)\n    }\n}\n\nclass Son extends Father{\n\n}\n\nconst SonObj = new Son();\nconsole.log(SonObj.getName());\n\n```\n\n\n#### 6. Overriding\n- Overriding works for inheritance relationship\n- When child class change his parent properties , that is overriding\n```sh\nclass Father {\n    //Properties\n     first_name='Jhon'\n     last_name='Dee'\n\n    //method\n     getName() {\n        return (`The name of the person is ${this.first_name} ${this.last_name}`)\n    }\n}\n\nclass Son extends Father{\n    // Overriding Occurs\n    first_name='Jhon Junior'\n}\nconst SonObj = new Son();\nconsole.log(SonObj.getName());\n```\n\n\n#### 7. Method Overloading\n- Method overloading allows you to define multiple methods with the same name but different parameter lists\n- JavaScript does not natively support method overloading\n\n\n#### 8. Polymorphism\n- The polymorphism is a core concept of an object-oriented paradigm\nthat provides a way to perform a single action in different forms.\n- We already know about Inheritance,Overriding,Overloading - those concepts together represent\npolymorphism\n\n#### 9. Abstraction\n- Keyword \"abstract\" use for class abstraction\n- You can't create object for abstract class\n- Abstract class Always needs its inherited child class to perform\n- JavaScript does not have built-in support for abstract\n\n#### Thank You \n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupomsoft%2Fjavascript-oop-tutorial-with-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frupomsoft%2Fjavascript-oop-tutorial-with-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frupomsoft%2Fjavascript-oop-tutorial-with-example/lists"}