I have tried this with console.log and it works, but I am stuck on how to turn it into a div
let N = 13;
let nums = Array.apply(1, { length: N }).map(Number.call, Number)
console.log(nums)
for (let el of nums) {
if (el <= 9) {
time = `0`+el+`:00`;
console.log(time);
} else if (el >= 9) {
time = el+`:00`
console.log(time);
}
}
I want to put it in jsx
class SchedulePage extends React.Component {
render(){
return (
<div className="schedule-page-container">
{right here}
</div>
);
}
}
Array.apply(1, { length: N }).map(Number.call, Number)can be replaced with[...Array(N).keys()]