pushing values in array ??

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

pushing values in array ??

Post 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.
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

Code: Select all

var a = Array();
a.push(1);
a.push(2);
User avatar
PHPycho
Forum Contributor
Posts: 336
Joined: Fri Jan 06, 2006 12:37 pm

Post by PHPycho »

Thanks Mr. Gente
That worked..
Post Reply