Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old September 22nd, 2003, 08:53 AM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Article Discussion: Defining JavaScript Arrays Using Literal Notation

If you have any questions or comments on this article then please post them here.

This forum post relates to this article.
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #2  
Old September 22nd, 2003, 04:17 PM
Invoked Invoked is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 1 Invoked User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Re: Article Discussion: Defining JavaScript Arrays Using Literal Notation

Hi,

Nice introduction to the javascript world of literals. While its not an overly complex topic, alot javascript programmers simply don't know that its an option. Thanks.

This method of coding lends itself to quick solutions. The less typing the better, as soon as the ideas come, you can see the results. There's no use declaring an Array object every time you want a stack or collection, javascript already does that behind the scenes. I think its also easier to read, as well.

I have a soft spot for this method of coding. It brings me back to my C++ training. If you started out in this type of environment, literal declaration of arrays in javascript are only natural. And it makes you realize that there's certain things within the language that stem more from C++ than Java.

Thanks Again,
-Terry

Reply With Quote
  #3  
Old August 16th, 2004, 08:17 PM
drlebey drlebey is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Location: chicagoland area
Posts: 1 drlebey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via MSN to drlebey
This literal notation code does not work for me using IE 6

I used the following code for this to work. I had to enclose each dimensions set of values in of their own set of brackets and each individual value in a set of quotation marks .
The code at the bottom gives you the following results....

inside1,inside2,inside3 middle1,middle2,middle3 outside1,outside2,outside3

Hope this helps someone, peace.

<html>
<head>
<title>Untitled</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">
<!--This is for a literal array multidimensional//-->

var myarray=[["inside1", "inside2", "inside3"], ["middle1", "middle2", "middle3"], ["outside1", "outside2", "outside3"]];
str1 = myarray.join(" ");
document.write(str1);
</script>

</body>
</html>

Last edited by drlebey : August 16th, 2004 at 08:24 PM. Reason: To better describe the reply

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > Article Discussion: Defining JavaScript Arrays Using Literal Notation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT