Home: Other Programming Languages: Javascript:
Arrays



sirus4u2c
Novice

Aug 13, 2003, 11:25 PM


Views: 42866
Arrays

could someone tell me how to remove a element from a array

@Ele = ("this","That","why","When");

How could I remove "That".

I was also wondering how to remove all the elements from the array in JavaScript


fashimpaur
User

Dec 31, 2003, 4:38 AM


Views: 42851
Re: [sirus4u2c] Arrays

I don't think this is going to do what you need but...

@Ele is Perl...

in JavaScript...

var Ele = new Array ("this","That","why","When");

Ele = [Ele[0],Ele.slice(2)];



Also, to empty an array try this ...

var Ele = new Array ("this","That","why","When");

Ele = new Array();

document.write Ele.length();



HTH,

Dennis




In Reply To
could someone tell me how to remove a element from a array

@Ele = ("this","That","why","When");

How could I remove "That".

I was also wondering how to remove all the elements from the array in JavaScript

Dennis

$a="c323745335d3221214b364d545".
"a362532582521254c3640504c3729".
"2f493759214b3635554c3040606a0",
print unpack"u*",pack "h*",$a,"\n\n";