Arrays / Populating arrays / Sorting in Javascript

August 1, 2007 at 5:16 am Leave a comment

<body>
<script language=”javascript”>
myarray=new Array(2);               //A array intialized of size 2
myarray[1]=”suresh”;
myarray[2]=”ganesh”;
for(i=1; i<3; i++)                 //loop goes here
document.write(myarray[i]+”<br>”);
document.write(myarray.sort());         //sorting array elements
</script>
</body>

Entry filed under: Javascript. Tags: .

Formating / multi formating strings in javascript Applying background to Iframe [IE / Firefox /Safari / Opera

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Flickr Photos

The firsts lights

Lago di Braies

Survivor Mode

More Photos

Blog Stats

  • 705,777 hits

%d bloggers like this: