Congratulations to all the winners of April 2013, they have won INR 3400 cash and INR 20147 worth prizes !
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 17012 |  Welcome, Guest!   Register  Login
 Home > Code Snippets > JavaScript > How to delete an entry using JavaScript ? ...
Bharathi Cherukuri

How to delete an entry using JavaScript ?

 Code Snippet posted by: Bharathi Cherukuri | Posted on: 7/11/2012 | Category: JavaScript Codes | Views: 480 | Status: [Member] | Points: 40 | Alert Moderator   


The "delete" operator removes an array element, but it does not change the size of the array.
See the below example for clear explanation.


<script type="text/javascript">
var days = ["Sunday","Monday","Tuesday","Wednesday", "Thursday","Friday","Saturday"];
document.write("Number of days:"+days.length);
delete days[4];
document.write("<br />Number of days:"+days.length);
</script>
This produces
Number of days:7
Number of days:7

Found interesting? Add this to:


>> Write Response - Respond to this post and get points

More codes snippets

About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 5/18/2013 5:00:18 AM