|
-
August 12th, 2008, 08:11 PM
#1
Javascript Hashes. Confusion.
Hello Everyone!
I am new to JS and esp to Object Oriented Javascript. I am having to deal with some complicated JS code that involves extensive use of hashes. The idea is that the data is being accessed from some Database and stored in these hashes. Although I know that a hash is essentially a key-value pair. I am confused with the following declaration and usage of hashes.
1. temp = aHash["A"][ some[i] ];
returnData[temp];
2. var b = hash[key]["B"];
3. cHash = d[ some[i] ];
if(cHash["A"])
{
doSomething....
}
Can someone please explain me above syntaxes with examples? Any help will be greatly appreciated.
-
August 13th, 2008, 06:46 AM
#2
Re: Javascript Hashes. Confusion.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
August 13th, 2008, 06:57 AM
#3
Re: Javascript Hashes. Confusion.
In JavaScript, the term hash is almost never used anymore. They are better known as associative arrays. If you understand a numerical indexed array, then you already understand an associative. Instead of using integers as the key, it uses a string. Then, you can also build as many dimensions as you like.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|