Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How tp create Arrays using JavaScript??
How tp create Arrays using JavaScript??
✍: Guest
<script type="text/javascript">
var days = new Array();
days[0] = "Sunday"
days[1] = "Monday"
days[2] = "Tuesday"
days[3] = "Wednesday"
days[4] = "Thursday"
days[5] = "Friday"
days[6] = "Saturday"
document.write("first day is "+days[0])
</script>
This produces:
first day is Sunday
A more compact way of creating an array is the literal notation:
<script type="text/javascript">
var days = ["Sunday","Monday","Tuesday","Wednesday",
"Thursday","Friday","Saturday"];
document.write("first day is "+days[0])
</script>
This produces
first day is Sunday
2011-07-12, 3868👍, 0💬
Popular Posts:
What Happens to Indexes If You Drop a Table? - Oracle DBA FAQ - Managing Oracle Table Indexes If you...
How do we host a WCF service in IIS? Note: - The best to know how to host a WCF in IIS is by doing a...
What invokes a thread's run() method? After a thread is started, via its start() method of the Threa...
What is the quickest sorting method to use? The answer depends on what you mean by quickest. For mos...
.NET INTERVIEW QUESTIONS - Where do you specify session state mode in ASP.NET ? The following code e...