{"id":117,"date":"2026-05-04T14:37:53","date_gmt":"2026-05-04T14:37:53","guid":{"rendered":"https:\/\/gigz.pk\/javascript\/?post_type=lesson&#038;p=117"},"modified":"2026-05-04T14:37:54","modified_gmt":"2026-05-04T14:37:54","slug":"properties-and-methods","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/javascript\/?lesson=properties-and-methods","title":{"rendered":"Properties and Methods"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Introduction<br>In JavaScript, properties and methods are essential concepts used to work with objects. They allow developers to store data and perform actions efficiently within web applications.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Understanding Properties<br>A property is a value associated with an object. It represents the characteristics or attributes of that object.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example<br>An object representing a user can have properties like name, age, and email. These values describe the object.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">JavaScript Example<br>let user = {<br>name: &#8220;Ali&#8221;,<br>age: 20,<br>email: &#8220;<a>ali@example.com<\/a>&#8220;<br>};<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Accessing Properties<br>You can access properties using dot notation or bracket notation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Dot Notation<br>user.name<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bracket Notation<br>user[&#8220;age&#8221;]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Understanding Methods<br>A method is a function stored inside an object. It defines actions that the object can perform.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">JavaScript Example<br>let person = {<br>name: &#8220;Sara&#8221;,<br>greet: function() {<br>console.log(&#8220;Hello&#8221;);<br>}<br>};<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Calling a Method<br>person.greet();<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Difference Between Properties and Methods<br>Properties store data or values<br>Methods perform actions or functions<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Built in Properties and Methods<br>JavaScript provides built in objects like String, Array, and Math that include useful properties and methods.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">String Example<br>let text = &#8220;JavaScript&#8221;;<br>text.length<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Array Example<br>let numbers = [1, 2, 3];<br>numbers.push(4);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why Properties and Methods Matter<br>They make code organized and reusable<br>They help manage complex data structures<br>They improve code readability and efficiency<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Best Practices<br>Use clear and meaningful property names<br>Keep methods simple and focused<br>Avoid unnecessary complexity in objects<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Conclusion<br>Understanding properties and methods is fundamental for mastering JavaScript. These concepts help developers create structured and interactive applications.<\/p>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/javascript\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">Intermediate JavaScript > Objects > Properties and Methods<\/span><\/span><\/div>\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1777905430529\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><div class=\"schema-faq-section\" id=\"faq-question-1777905430150\"><strong class=\"schema-faq-question\"><\/strong> <p class=\"schema-faq-answer\"><\/p> <\/div> <\/div>\n","protected":false},"menu_order":0,"template":"","class_list":["post-117","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Properties and Methods - Learn JavaScript with GIGZ.PK<\/title>\n<meta name=\"description\" content=\"Learn JavaScript properties and methods to work with objects create dynamic functions and build interactive web applications easily\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/javascript\/?lesson=properties-and-methods\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Properties and Methods - Learn JavaScript with GIGZ.PK\" \/>\n<meta property=\"og:description\" content=\"Learn JavaScript properties and methods to work with objects create dynamic functions and build interactive web applications easily\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/javascript\/?lesson=properties-and-methods\" \/>\n<meta property=\"og:site_name\" content=\"Learn JavaScript with GIGZ.PK\" \/>\n<meta property=\"article:modified_time\" content=\"2026-05-04T14:37:54+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?lesson=properties-and-methods\",\"url\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?lesson=properties-and-methods\",\"name\":\"Properties and Methods - Learn JavaScript with GIGZ.PK\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/#website\"},\"datePublished\":\"2026-05-04T14:37:53+00:00\",\"dateModified\":\"2026-05-04T14:37:54+00:00\",\"description\":\"Learn JavaScript properties and methods to work with objects create dynamic functions and build interactive web applications easily\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?lesson=properties-and-methods#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?lesson=properties-and-methods\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?lesson=properties-and-methods#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/javascript\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Intermediate JavaScript > Objects > Properties and Methods\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/\",\"name\":\"Learn JavaScript with GIGZ.PK\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/javascript\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Properties and Methods - Learn JavaScript with GIGZ.PK","description":"Learn JavaScript properties and methods to work with objects create dynamic functions and build interactive web applications easily","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/gigz.pk\/javascript\/?lesson=properties-and-methods","og_locale":"en_US","og_type":"article","og_title":"Properties and Methods - Learn JavaScript with GIGZ.PK","og_description":"Learn JavaScript properties and methods to work with objects create dynamic functions and build interactive web applications easily","og_url":"https:\/\/gigz.pk\/javascript\/?lesson=properties-and-methods","og_site_name":"Learn JavaScript with GIGZ.PK","article_modified_time":"2026-05-04T14:37:54+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/javascript\/?lesson=properties-and-methods","url":"https:\/\/gigz.pk\/javascript\/?lesson=properties-and-methods","name":"Properties and Methods - Learn JavaScript with GIGZ.PK","isPartOf":{"@id":"https:\/\/gigz.pk\/javascript\/#website"},"datePublished":"2026-05-04T14:37:53+00:00","dateModified":"2026-05-04T14:37:54+00:00","description":"Learn JavaScript properties and methods to work with objects create dynamic functions and build interactive web applications easily","breadcrumb":{"@id":"https:\/\/gigz.pk\/javascript\/?lesson=properties-and-methods#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/javascript\/?lesson=properties-and-methods"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/javascript\/?lesson=properties-and-methods#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/javascript"},{"@type":"ListItem","position":2,"name":"Intermediate JavaScript > Objects > Properties and Methods"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/javascript\/#website","url":"https:\/\/gigz.pk\/javascript\/","name":"Learn JavaScript with GIGZ.PK","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/javascript\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/javascript\/index.php?rest_route=\/wp\/v2\/lesson\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/javascript\/index.php?rest_route=\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/javascript\/index.php?rest_route=\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/javascript\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}