{"id":2440,"date":"2022-07-24T17:48:30","date_gmt":"2022-07-24T17:48:30","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=2440"},"modified":"2022-07-24T17:48:32","modified_gmt":"2022-07-24T17:48:32","slug":"set-size-property-javascript","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/set-size-property-javascript\/","title":{"rendered":"Set Size Property JavaScript"},"content":{"rendered":"<p style=\"text-align: center;\"><strong>Getting the size of the set (size property)<\/strong><\/p>\n<p>Now, if we want to know the size of the set, which means how many elements are there in our set, then we can make use of the size property. Have a look at the below program, where we are trying to use the size property &#8211;<\/p>\n<h3 style=\"text-align: center;\">Size Property<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1773 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property.jpg\" alt=\"\" width=\"1258\" height=\"190\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property.jpg 1258w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property-300x45.jpg 300w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property-1024x155.jpg 1024w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property-768x116.jpg 768w\" sizes=\"auto, (max-width: 1258px) 100vw, 1258px\" \/><\/p>\n<p>If you try to have a look at the output, it looks something like this &#8211;<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1774 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property-1.jpg\" alt=\"\" width=\"1600\" height=\"240\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property-1.jpg 1600w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property-1-300x45.jpg 300w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property-1-1024x154.jpg 1024w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property-1-768x115.jpg 768w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/Getting-the-size-of-the-setsize-property-1-1536x230.jpg 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><br \/>\nAs you can see, the set contains 6 unique elements in it. So, the size of the set comes out to be 6. So, whenever we need the size of the set, we can make use of the size property for the given set, and get the size of the given set.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Getting the size of the set (size property) Now, if we want to know the size of the set, which means how many elements are there in our set, then we can make use of the size property. Have a look at the below program, where we are trying to use the size property &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[14,15],"class_list":{"0":"post-2440","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-javascript-tutorial","7":"tag-javascript","8":"tag-javascript-tutorial"},"_links":{"self":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/2440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/comments?post=2440"}],"version-history":[{"count":2,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/2440\/revisions"}],"predecessor-version":[{"id":2452,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/2440\/revisions\/2452"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=2440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=2440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=2440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}