Categories:
.NET (357)
C (330)
C++ (184)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (2)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How to use strings as array indexes using JavaScript?
How to use strings as array indexes using JavaScript?
✍: Guest
Javascript does not have a true hashtable object, but through its wierdness, you can use the array as a hashtable.
<script type="text/javascript">
var days = ["Sunday","Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday"];
for(var i=0; i < days.length; i++) {
days[days[i]] = days[i];
}
document.write("days[\"Monday\"]:"+days["Monday"]);
</script>
This produces
days["Monday"]:Monday
2011-07-19, 4005👍, 0💬
Popular Posts:
How To Download and install PSP Evaluation? - PSP Tutorials - Fading Images to Background Colors wit...
Can we have shared events ? Yes, you can have shared event’s note only shared methods can raise shar...
Can one change the mouse pointer in Forms? The SET_APPLICATION_PROPERTY build-in in Oracle Forms all...
If we have the following in a Java code: String s="abc"; String s2="abc"; Then what will be output o...
If we have multiple AFTER Triggers on table how can we define the sequence of the triggers ? If a ta...