{"id":1300,"date":"2011-01-12T22:47:38","date_gmt":"2011-01-12T22:47:38","guid":{"rendered":"http:\/\/www.codingfriends.com\/?p=1300"},"modified":"2011-01-12T22:47:38","modified_gmt":"2011-01-12T22:47:38","slug":"delete-object-from-array-within-javascript","status":"publish","type":"post","link":"https:\/\/www.codingfriends.com\/index.php\/2011\/01\/12\/delete-object-from-array-within-javascript\/","title":{"rendered":"Delete object from array within javascript"},"content":{"rendered":"<p>Someone asked me whilst doing a job how to delete parts of a array within javascript, so just like other object oriented languages, you can have a array of data objects and each one can be accessible and removable.  To achieve this with javascript you use the delete method as below.<\/p>\n<pre lang=\"javascript\">\r\nvar myArray = new Array();\r\nmyArray[0] = \"first value\";\r\nmyArray[1] = \"second value\";\r\n\r\n\/\/ and to delete the second value\r\ndelete myArray[1];\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Someone asked me whilst doing a job how to delete parts of a array within javascript, so just like other object oriented languages, you can have a array of data objects and each one can be accessible and removable. To achieve this with javascript you use the delete method as below. var myArray = new &hellip; <a href=\"https:\/\/www.codingfriends.com\/index.php\/2011\/01\/12\/delete-object-from-array-within-javascript\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Delete object from array within javascript<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[285],"class_list":["post-1300","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-delete-from-array"],"_links":{"self":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/comments?post=1300"}],"version-history":[{"count":1,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1300\/revisions"}],"predecessor-version":[{"id":1301,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1300\/revisions\/1301"}],"wp:attachment":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/media?parent=1300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/categories?post=1300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/tags?post=1300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}