Page 1 of 1

pushing values in array ??

Posted: Tue Jul 03, 2007 6:22 am
by PHPycho
Hello forums !!
I would like to push the values in array(without specifying index).
Can anybody give me the suggestion.
Note: It should be equivalent to PHP's

Code: Select all

$exp_array = array();
$exp_array[] = "value1";
$exp_array[] = "value2";
(without specifying indexes)
...........etc

Thanks in advance to all of you.

Posted: Tue Jul 03, 2007 6:28 am
by Gente

Code: Select all

var a = Array();
a.push(1);
a.push(2);

Posted: Tue Jul 03, 2007 6:36 am
by PHPycho
Thanks Mr. Gente
That worked..