{"id":2438,"date":"2022-07-24T17:55:00","date_gmt":"2022-07-24T17:55:00","guid":{"rendered":"https:\/\/gyanipandit.com\/programming\/?p=2438"},"modified":"2022-07-24T17:55:02","modified_gmt":"2022-07-24T17:55:02","slug":"javascript-set-delete","status":"publish","type":"post","link":"https:\/\/gyanipandit.com\/programming\/javascript-set-delete\/","title":{"rendered":"JavaScript Set Delete() Method"},"content":{"rendered":"<p style=\"text-align: center;\"><strong>How to delete some element from the set (delete method)<\/strong><\/p>\n<p>Now, we have seen how can we add some elements to the set.<\/p>\n<p>But if you want to delete some element from the set, how are we going to do that? Well, again we have a method for that. The method that we are going to use is called the delete method. You have guessed it right, that we are going to delete some elements using the delete method now.<\/p>\n<h3 style=\"text-align: center;\">JavaScript Set Delete Method<\/h3>\n<p>Have a look at the below program, where we are trying to make use of the delete method, to delete some elements from the set &#8211;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1775 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method.jpg\" alt=\"\" width=\"1249\" height=\"253\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method.jpg 1249w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method-300x61.jpg 300w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method-1024x207.jpg 1024w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method-768x156.jpg 768w\" sizes=\"auto, (max-width: 1249px) 100vw, 1249px\" \/><\/p>\n<p>If we have a look at the output now, we can find that element 3 is now deleted from the set, which existed earlier. Have a look at the output &#8211;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1776 size-full\" src=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method-1.jpg\" alt=\"\" width=\"1600\" height=\"288\" srcset=\"https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method-1.jpg 1600w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method-1-300x54.jpg 300w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method-1-1024x184.jpg 1024w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method-1-768x138.jpg 768w, https:\/\/gyanipandit.com\/programming\/wp-content\/uploads\/2022\/06\/How-to-delete-some-element-from-the-setdelete-method-1-1536x276.jpg 1536w\" sizes=\"auto, (max-width: 1600px) 100vw, 1600px\" \/><\/p>\n<p>As you can see, the element that we wanted to delete, is now deleted from the set. This is pretty simple, and you can try out some more examples, to become familiar with the concept of the set, and we can use the method as and when required.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to delete some element from the set (delete method) Now, we have seen how can we add some elements to the set. But if you want to delete some element from the set, how are we going to do that? Well, again we have a method for that. The method that we are going [&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-2438","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\/2438","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=2438"}],"version-history":[{"count":2,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/2438\/revisions"}],"predecessor-version":[{"id":2453,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/posts\/2438\/revisions\/2453"}],"wp:attachment":[{"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/media?parent=2438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/categories?post=2438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gyanipandit.com\/programming\/wp-json\/wp\/v2\/tags?post=2438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}