var days = [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
];
document.getElementById("demo2").innerHTML = days[0] + "<br>" +
days[1] + "<br>" +
days[2] + "<br>" +
days[3] + "<br>" +
days[4] + "<br>" +
days[5] + "<br>" + days[6];
body {
margin: 0;
padding: 0;
}
table {
border: 1px solid #000;
border-collapse: collapse;
width: 500px;
height: 150px;
margin: 5px;
}
table tr td {
border:1px solid #000;
padding-left:10px;
}
<h1>Concatenation Challenge</h1>
<table>
<tr>
<td>All days of the week</td>
<td id="demo2"></td>
</tr>
</table>
Hi, this sounds like a weird question. Is there a way to display from [0] to [6] without mentioning in-between numbers(1-5)? I tried for loop but I don't think I am doing it right. for (var i=0;i > days.length;i++);