Register on the forum now to remove ALL ads + popups + get access to tons of hidden content for members only!

Go Back   Site Owners Forums - Webmaster Forums > Web Programming > Programming General > Javascript

Notices


Reply
 
Thread Tools Rate Thread Display Modes
Old 02-10-2016, 01:16 AM   #1
chinmay.sahoo
Registered User
 
Join Date: Dec 2013
Location: Banglore
Posts: 335
Send a message via AIM to chinmay.sahoo Send a message via MSN to chinmay.sahoo
Arrow How to delete an entry using JavaScript?

The "delete" operator removes an array element, but oddly does not change the size of the array.

Quote:
<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





Step Up Height Increaser
Sandhi Sudha
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
chinmay.sahoo is offline   Reply With Quote

Old 03-24-2016, 10:07 PM   #2
dungtuyet
Registered User
 
Join Date: Jan 2016
Posts: 32
The "delete" operator removes an array element, but oddly does not change the size of the array.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
dungtuyet is offline   Reply With Quote
Old 03-16-2017, 01:16 AM   #3
sonvi.belani
Registered User
 
Join Date: Jan 2017
Location: Ahmedabad
Posts: 126
Hi,

You have need to refer this link for Delete an entry using javascript from array.
http://stackoverflow.com/questions/5...-in-javascript

Thanks
__________________
Sonvi Belani
Ecommerce Website Developer

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
sonvi.belani is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Implement Interfaces in JavaScript JavaScriptBank Javascript 1 03-31-2014 12:48 AM
Javascript Countdown Timer redirecting Affiliate Links JavaScriptBank Javascript 0 05-20-2013 11:29 PM
40 Super Nice JavaScript Extensions and Plugins JavaScriptBank Javascript 0 04-29-2013 12:14 AM
9 Funniest JavaScript effects JavaScriptBank Javascript 0 04-18-2013 03:13 AM
65 Free JavaScript Photo Gallery Solutions JavaScriptBank Javascript 0 04-15-2013 07:38 PM


All times are GMT -7. The time now is 08:33 PM.


Powered by vBulletin Copyright © 2013 vBulletin Solutions, Inc.