Skip to content

Instantly share code, notes, and snippets.

@AminBusiness
Last active June 13, 2018 03:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AminBusiness/30ce170b7af6ec9fc9c5554045283381 to your computer and use it in GitHub Desktop.
Save AminBusiness/30ce170b7af6ec9fc9c5554045283381 to your computer and use it in GitHub Desktop.
// source https://jsbin.com
function main() {
var lcv;
var months = new Array(13); //Create an Array object
months[0] = "";
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
//Loops through the 12 months in order
for(lcv in months)
{
document.write("Month " + lcv + " is " +
months[lcv] + "<br />");
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
function main() {
var lcv;
var months = new Array(13); //Create an Array object
months[0] = "";
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
//Loops through the 12 months in order
for(lcv in months)
{
document.write("Month " + lcv + " is " +
months[lcv] + "<br />");
}
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">function main() {
var lcv;
var months = new Array(13); //Create an Array object
months[0] = "";
months[1] = "January";
months[2] = "February";
months[3] = "March";
months[4] = "April";
months[5] = "May";
months[6] = "June";
months[7] = "July";
months[8] = "August";
months[9] = "September";
months[10] = "October";
months[11] = "November";
months[12] = "December";
//Loops through the 12 months in order
for(lcv in months)
{
document.write("Month " + lcv + " is " +
months[lcv] + "<br />");
}
}</script></body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment