{"id":11356,"date":"2016-03-08T16:15:41","date_gmt":"2016-03-08T14:15:41","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=11356"},"modified":"2018-10-26T16:32:59","modified_gmt":"2018-10-26T13:32:59","slug":"javascript-properties-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/","title":{"rendered":"JavaScript Properties Example"},"content":{"rendered":"<p>Properties are one of the most basic Javascript notions. Basic to the point that they are more often than not overlooked in the language&#8217;s literature. However, it&#8217;s crucial to know and study them even for those who only want to have even the most elementary knowledge about JS. <\/p>\n<h2>1. What are Properties exactly?<\/h2>\n<p>According to the official definition in the Javascript documentation, an object having a property means having an &#8220;association between a property name and its value.&#8221; Though, if you want an even clearer version of that definition, think of properties as the building blocks of an object, as these two concepts (and variables too) are very deeply interwoven with each other. <\/p>\n<p>You can even think of properties as objects in and of itself, as they not only have a string for a name but also a set of attributes assigned to them. <\/p>\n<p>We can divide properties in different types based on different qualifications. For starters, what we defined above are called direct properties as there is a direct association between a property name and it&#8217;s value. Except for that we have properties whose values are assigned indirectly through <em>getters<\/em> and <em>setters<\/em> which are simply functions associated with property values. <\/p>\n<p>Moreover, a property can be <em>own<\/em> or <em>inherited<\/em>, based on where it is contained in the prototype chain. While the first ones are contained directly by the object, the second type can be contained by one of the other object whose child our object is. <\/p>\n<p>Also, we divide properties into <em>named<\/em> and <em>internal<\/em> based on whether they are or not a part of ECMAScript. We&#8217;ll take a short look on these later.<br \/>\n&nbsp;<br \/>\n[ulp id=&#8217;tCIwOngQUb3zSUuF&#8217;]<\/p>\n<h2>2. Property Attributes<\/h2>\n<p>There are a number of attributes assigned to a property depending on the type it is, but there are two that are common for each one. These two are <code>Enumerable<\/code> and <code>Configurable<\/code>. When the first one is set to the boolean value <code>TRUE<\/code>, that means that the property can be enumerated using a <code>for...in<\/code> enumeration, while when the second one is set to <code>FALSE<\/code> it prevents the property from being deleted or modified in any way. If <code>Configurable<\/code> has been set to <code>FALSE<\/code> once, it cannot be reversed, and also you can&#8217;t change the other properties (except setting <code>Value<\/code> and <code>Writable<\/code> from true to false, the vice versa not-withstanding).<\/p>\n<h3>2.1 Named Properties<\/h3>\n<p>We mentioned that properties are divided into <em><strong>named<\/strong><\/em> and <em><strong>internal<\/strong><\/em>. Named properties are further divided into named <em>data<\/em> properties and named <em>accessor<\/em> properties. Let&#8217;s take a look at each one separately below.<\/p>\n<h4>2.1.1 Named Data Properties<\/h4>\n<p>A named data property means having a property with two very important components: a name and a value that is directly associated to it. Additionally to the general attributes these types of properties also have two other attributes, which are <em>Value<\/em> and <em>Writable<\/em>. The first one specifies a values retrieved when reading the property, while the second, when set to <code>FALSE<\/code>, prevents the internal method <code>Put<\/code> from changing the <code>Value<\/code> attribute of the property. Take a look below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>properties.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\nObject.defineProperty(this, \"MYVAR\", {\r\n  value: 100\r\n});\r\n\r\nconsole.log(MYVAR);  \/\/ result: 100\r\n<\/pre>\n<p>What we have done here is just define a named data property, giving it a value of 100. If we try to later change this value or completely delete the property we will be presented with an error, since by default we would have <code>[[Writable]] = false<\/code> (which prevents rewriting) and <code>[[Configurable]] = false<\/code> (which would prevent deleting of otherwise changing it). The default data property attributes would be these:<\/p>\n<p><span style=\"text-decoration: underline\"><em>properties.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\nvar defaultDataPropertyAttributes = {\r\n  [[Value]]: undefined,\r\n  [[Writable]]: false,\r\n  [[Enumerable]]: false,\r\n  [[Configurable]]: false\r\n};\r\n<\/pre>\n<h4>2.1.2 Named Accessor Properties<\/h4>\n<p>While Named Data Properties were composed by a name and a value associated directly to it, a Named Accessor Property is formed by a name and one or two accessor function which would be <em>getters<\/em> or <em>setters<\/em> associated indirectly to it. <\/p>\n<p>In this case, except for the two general attributes, there are two more added, which are <code>Get<\/code> and <code>Set<\/code>. <code>Get<\/code> is a function object which is called every time for retrieving indirect value related with the property name, while, understandably, <code>Set<\/code> does is the function object who does the setting of the value associated with the property name. Take a look:<\/p>\n<p><span style=\"text-decoration: underline\"><em>properties.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\nvar myvar = {\r\n \r\n  get wcg () {\r\n    return 20;\r\n  },\r\n \r\n  set wcg (value) {\r\n    console.log(value);\r\n  }\r\n \r\n};\r\n\r\nvar defaultAccessorPropertyAttributes = {\r\n  [[Get]]: undefined,\r\n  [[Set]]: undefined,\r\n  [[Enumerable]]: false,\r\n  [[Configurable]]: false\r\n};\r\n<\/pre>\n<p>This is how we have defined a named accessor property and below there are the default values of it&#8217;s attributes. If we tried to overwrite <code>wcg<\/code>&#8216;s value, say using this line of code <code>myvar.wcg = 100;<\/code>, we wouldn&#8217;t be able to do it, since the <code>Set<\/code> value is empty. <\/p>\n<h3>2.2 Internal Properties<\/h3>\n<p>Objects can have a number of internal properties which are part of the implementations and not accessible with ECMAScript programs. These properties are enclosed by double square brackets (i.e [[Writable]]). For these properties there are a number of extra attributes except for the two general ones. <\/p>\n<p>Some of the most used ones are:<\/p>\n<ul>\n<li><code>[[Prototype]]<\/code> &#8211; it represents the prototype of the object<\/li>\n<li><code>[[Class]]<\/code> &#8211; represents the type of the object such as Array, String, etc.<\/li>\n<li><code>[[Get]]<\/code> &#8211; method that gets a property&#8217;s value<\/li>\n<li><code>[[Put]]<\/code> -method that sets a property&#8217;s value<\/li>\n<\/ul>\n<p>It is important to note that the <code>[[Get]]<\/code> you see here is not the same as the data attribute in named accessor properties, as this is a <em>method<\/em> that calls the <code>Get<\/code> property, with <code>[[Put]]<\/code> having the same effect on the <code>Set<\/code> property.<\/p>\n<h2>3. Property Accessors<\/h2>\n<p>Property Accessors are what we use to get access to an object&#8217;s properties. This can be done in two ways: by using the dot notation and by using the square bracket notation. The syntax for both is fairly easy:<\/p>\n<p><span style=\"text-decoration: underline\"><em>syntax.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\nobject.property\r\nobject[\"property\"]\r\n<\/pre>\n<p>This is how we use the dot notation to access a property in real code:<\/p>\n<p><span style=\"text-decoration: underline\"><em>properties.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\nperson.firstname + \" is \" + person.age + \" years old.\";\r\n<\/pre>\n<p>What you have to keep in mind here is that the property name has to be alphanumerical, and not start with numbers, underscores or dollar signs as the code would be invalid. Below you can see how we use the square bracket notation to do the same job, albeit a bit differently:<\/p>\n<p><span style=\"text-decoration: underline\"><em>properties.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\nperson[\"firstname\"] + \" is \" + person[\"age\"] + \" years old.\";\r\n\r\nperson[firstname] + \" is \" + person[age] + \" years old.\";\r\n<\/pre>\n<p>Both ways shown in the code snippet above are valid. This method also doesn&#8217;t impose on your code the limitation presented by the dot notation about your property not starting with a number, underscore or dollar sign. In this case, your property can be whatever.<\/p>\n<h2>4. Defining Properties<\/h2>\n<p>While explaining all of the above, you might have noticed that we used different methods to define a property. There are lots of ways for you to do this, but 5 are the most famous among programmers:<\/p>\n<ol>\n<li>dot notation<\/li>\n<li>square bracket notation<\/li>\n<li>leaving out the <code>var<\/code> keyword<\/li>\n<li>Object.defineProperty()<\/li>\n<li>Object.defineProperties()<\/li>\n<\/ol>\n<p>This is how we would use the first three methods to define a property, as the two last ones will be explained to you in more detail:<\/p>\n<p><span style=\"text-decoration: underline\"><em>properties.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\n\/\/dot notation\r\nwindow.foo = 'hello';\r\n \r\n\/\/subscript notation\r\nwindow['foo'] = 'hello';\r\n \r\n\/\/leaving out the var keyword\r\nvar bar = function() {\r\n    foo = \"hello\";\r\n}\r\n<\/pre>\n<h3>4.1 Object.defineProperty()<\/h3>\n<p><code>Object.defineProperty()<\/code> is a method that defines a new property directly into an object or modifies an already existing one and returns the object. It&#8217;s syntax would go like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>syntax.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\nObject.defineProperty(obj, prop, descriptor)\r\n<\/pre>\n<p>As you see, this method takes three arguments, the first one being the object on which we want the property to be defined\/modified, the second is the property in question and the last is the property&#8217;s descriptor which is the set of a property&#8217;s attributes and their values.<\/p>\n<p>By default the values of these properties that are created or modified are deletable, enumerable, and their values may be changed later on. However, these attributes&#8217; values can be changed later on. <\/p>\n<h4>4.1.1 Creating Properties<\/h4>\n<p>When the property specified in the <code>Object.defineProperty()<\/code> method does not previously exist, it is created into it. The descriptor can be left unprovided (or parts of it unspecified) and the default values will be provided instead. The code would go like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>properties.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\nvar myvar = {}; \r\n\r\nObject.defineProperty(myvar, 'a', {\r\n  value: 100,\r\n  writable: true,\r\n  enumerable: true,\r\n  configurable: true\r\n});\r\n<\/pre>\n<p>Can you guess the type of the property <code>a<\/code> based on the code above? You&#8217;re right, it&#8217;s a Named Data Property. Not much would change for the other types though.<\/p>\n<h4>4.1.2 Modifying Properties<\/h4>\n<p>Modifying properties can turn out to be a bit more tricky than creating them, even though it&#8217;s no rocket science. The method will attempt to modify the specified property in case it already exists. However, the attributes <code>Writable<\/code>, <code>Enumerable<\/code> and <code>Configurable<\/code> limit this. Take a look and let&#8217;s explain from there:<\/p>\n<p><span style=\"text-decoration: underline\"><em>properties.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\nObject.defineProperty(o, 'a', {\r\n  value: 100,\r\n  writable: false\r\n});\r\n<\/pre>\n<p>As you see, the attribute <code>Writable<\/code> is set to false, so any attempt at modifying the value would be moot. In case that <code>Enumerable<\/code> was the one set to false, the property would give us the opportunity to reassign a different value, but the property wouldn&#8217;t turn out in <code>for...in<\/code> cycles of enumeration. If it was <code>Configurable<\/code> the attribute which was set to false, we would not be able to modify the property&#8217;s attributes, except for <code>Writable<\/code>.<\/p>\n<h3>4.2 Object.defineProperties()<\/h3>\n<p><code>Object.defineProperties()<\/code> is a method that works similarly to the one above, only it adds many properties at the same time. However it&#8217;s not used very much as it has a very major catch: It only works on Chrome and Safari. You&#8217;d be able to use it like below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>properties.js<\/em><\/span><\/p>\n<pre class=\"brush:js\"> \r\nObject.defineProperties(window, {\"foo\": {value: \"hello\"},\"bar\": {value: \"goodbye\"}});\r\n<\/pre>\n<p>Now you&#8217;re fully able to understand and use Javascript Properties in detail.<\/p>\n<h2>5. Download the source code <\/h2>\n<p>This was an example of Properties in Javascript. <\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>You can download the full source code of this example here: <strong><a><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/03\/Properties.zip\">Properties<\/a><\/a><\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Properties are one of the most basic Javascript notions. Basic to the point that they are more often than not overlooked in the language&#8217;s literature. However, it&#8217;s crucial to know and study them even for those who only want to have even the most elementary knowledge about JS. 1. What are Properties exactly? According to &hellip;<\/p>\n","protected":false},"author":25,"featured_media":920,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-11356","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-javascript"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JavaScript Properties Example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Properties are one of the most basic Javascript notions. Basic to the point that they are more often than not overlooked in the language&#039;s literature.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JavaScript Properties Example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Properties are one of the most basic Javascript notions. Basic to the point that they are more often than not overlooked in the language&#039;s literature.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/era.balliu.7\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-08T14:15:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-26T13:32:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Era Balliu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@BalliuEra\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Era Balliu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/\"},\"author\":{\"name\":\"Era Balliu\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c27ecf40c810e6396ba93ffb829c7b0e\"},\"headline\":\"JavaScript Properties Example\",\"datePublished\":\"2016-03-08T14:15:41+00:00\",\"dateModified\":\"2018-10-26T13:32:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/\"},\"wordCount\":1499,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"articleSection\":[\"JavaScript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/\",\"name\":\"JavaScript Properties Example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"datePublished\":\"2016-03-08T14:15:41+00:00\",\"dateModified\":\"2018-10-26T13:32:59+00:00\",\"description\":\"Properties are one of the most basic Javascript notions. Basic to the point that they are more often than not overlooked in the language's literature.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JavaScript\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/javascript\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"JavaScript Properties Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c27ecf40c810e6396ba93ffb829c7b0e\",\"name\":\"Era Balliu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f6adddf7eada210f682608fea9d8159441369ec622998a5851a447e0a2bfa3f3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f6adddf7eada210f682608fea9d8159441369ec622998a5851a447e0a2bfa3f3?s=96&d=mm&r=g\",\"caption\":\"Era Balliu\"},\"description\":\"Era is a Telecommunications Engineering student, with a great passion for new technologies. Up until now she has been coding with HTML\/CSS, Bootstrap and other front-end coding languages and frameworks, and her recent love is Angular JS.\",\"sameAs\":[\"http:\/\/www.webcodegeeks.com\/\",\"https:\/\/www.facebook.com\/era.balliu.7\",\"https:\/\/www.instagram.com\/eraballiu\/\",\"https:\/\/www.linkedin.com\/in\/eraballiu\",\"https:\/\/www.pinterest.com\/001r2gw0jt0ln6d\/\",\"https:\/\/x.com\/BalliuEra\",\"https:\/\/www.youtube.com\/c\/eraballiu\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/era-balliu\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JavaScript Properties Example - Web Code Geeks - 2026","description":"Properties are one of the most basic Javascript notions. Basic to the point that they are more often than not overlooked in the language's literature.","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:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/","og_locale":"en_US","og_type":"article","og_title":"JavaScript Properties Example - Web Code Geeks - 2026","og_description":"Properties are one of the most basic Javascript notions. Basic to the point that they are more often than not overlooked in the language's literature.","og_url":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/era.balliu.7","article_published_time":"2016-03-08T14:15:41+00:00","article_modified_time":"2018-10-26T13:32:59+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","type":"image\/jpeg"}],"author":"Era Balliu","twitter_card":"summary_large_image","twitter_creator":"@BalliuEra","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Era Balliu","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/"},"author":{"name":"Era Balliu","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c27ecf40c810e6396ba93ffb829c7b0e"},"headline":"JavaScript Properties Example","datePublished":"2016-03-08T14:15:41+00:00","dateModified":"2018-10-26T13:32:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/"},"wordCount":1499,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","articleSection":["JavaScript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/","url":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/","name":"JavaScript Properties Example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","datePublished":"2016-03-08T14:15:41+00:00","dateModified":"2018-10-26T13:32:59+00:00","description":"Properties are one of the most basic Javascript notions. Basic to the point that they are more often than not overlooked in the language's literature.","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/js-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/javascript\/javascript-properties-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"JavaScript","item":"https:\/\/www.webcodegeeks.com\/category\/javascript\/"},{"@type":"ListItem","position":3,"name":"JavaScript Properties Example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/c27ecf40c810e6396ba93ffb829c7b0e","name":"Era Balliu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f6adddf7eada210f682608fea9d8159441369ec622998a5851a447e0a2bfa3f3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f6adddf7eada210f682608fea9d8159441369ec622998a5851a447e0a2bfa3f3?s=96&d=mm&r=g","caption":"Era Balliu"},"description":"Era is a Telecommunications Engineering student, with a great passion for new technologies. Up until now she has been coding with HTML\/CSS, Bootstrap and other front-end coding languages and frameworks, and her recent love is Angular JS.","sameAs":["http:\/\/www.webcodegeeks.com\/","https:\/\/www.facebook.com\/era.balliu.7","https:\/\/www.instagram.com\/eraballiu\/","https:\/\/www.linkedin.com\/in\/eraballiu","https:\/\/www.pinterest.com\/001r2gw0jt0ln6d\/","https:\/\/x.com\/BalliuEra","https:\/\/www.youtube.com\/c\/eraballiu"],"url":"https:\/\/www.webcodegeeks.com\/author\/era-balliu\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/11356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=11356"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/11356\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/920"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=11356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=11356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=11356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}