JS Array

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

JS Array

Post by tecktalkcm0391 »

How do I do this PHP code in Javascript:

Code: Select all

<?php 
$e = array();

$e[] = 'One';
$e[] = 'Two';

$total = implode('',$e);
?>
All I have is:

Code: Select all

var e = new Array();

alert( e.join(""));
How do I make the "add array" (the $e[] = 'One'..ect.) happen?
User avatar
JellyFish
DevNet Resident
Posts: 1361
Joined: Tue Feb 14, 2006 7:18 pm
Location: San Diego, CA

Post by JellyFish »

User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

look at the push and split methods.

http://www.devguru.com/technologies/ecm ... array.html
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Post by tecktalkcm0391 »

Thanks, I got it.
Post Reply