{"id":1229,"date":"2023-05-21T07:08:02","date_gmt":"2023-05-21T07:08:02","guid":{"rendered":"https:\/\/itnotes.apjsoftwares.com\/?p=1229"},"modified":"2023-05-21T07:08:03","modified_gmt":"2023-05-21T07:08:03","slug":"what-is-oops-concept-in-javascript","status":"publish","type":"post","link":"https:\/\/itnotes.apjsoftwares.in\/index.php\/2023\/05\/21\/what-is-oops-concept-in-javascript\/","title":{"rendered":"What is OOPS Concept in JavaScript?"},"content":{"rendered":"\n<p>Many times, variables or arrays are not sufficient to simulate real-life situations. JavaScript allows you to create objects that act like real-life objects. A student or a home can be an object that has many unique characteristics of its own. You can create properties and methods for your objects to make programming easier. If your object is a student, it will have properties like the first name, last name, id, etc., and methods like calculating rank, change address, etc. If your object is a home, it will have properties like a number of rooms, paint color, location, etc. The methods like to calculate area, change owner, etc.<\/p>\n\n\n\n<p>How to Create an Object<\/p>\n\n\n\n<p>You can create an object like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">var objName = new\t\tObject();\nobjName.property1 = value1;\nobjName.property2 = value2;\nobjName.method1 = function()\n{\nline of code\t\n}\n<\/pre>\n\n\n\n<p>OR<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">var objName= {property1:value1, property2:value2, method1: function()\n\n{ lines of code} };<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Many times, variables or arrays are not sufficient to simulate real-life situations. JavaScript allows you&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[23],"tags":[],"_links":{"self":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1229"}],"collection":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/comments?post=1229"}],"version-history":[{"count":1,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1229\/revisions"}],"predecessor-version":[{"id":1230,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/posts\/1229\/revisions\/1230"}],"wp:attachment":[{"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/media?parent=1229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/categories?post=1229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itnotes.apjsoftwares.in\/index.php\/wp-json\/wp\/v2\/tags?post=1229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}