Bulkan Evcimen

Javascript....

var myArray = new Array();
myArray[0] = "hello";
myArray[1] = "merhaba";
myArray[2] = "ciao";

for (var i=0;i
alert(myArray[i]);

var myOtherArray = [];
myOtherArray[0] = "hello";
myOtherArray[1] = "merhaba";
myOtherArray[2] = "ciao";

for (var i=0;i
alert(myOtherArray[i]);


Can someone tell me the difference in these Vectors....i mean Arrays that are dynamic in size but you can't delete a single element at index X.

EDIT:

After all this pain and Googling, i found how to remove elements from an array in javascript.
A big fvcking round of applause for the splice method.

splice(index,length): starting from index remove elements until length.

Comments

James Wang - 2008-07-15 10:33:40
splice(index,length) Nice!! I'll keep that in mind

Post a comment

a,b tags are allowed, rest are stripped
Email wont be spammed.I promise

CSS Layout by Rambling Soul