I'm using a Vue component to render some table header as follows:
render (createElement) {
return createElement('div', { class: 'header' },
Array.apply(null, { length: this.initHours.length }).map(() => {
return createElement('div', { class: 'frame' }, this.getHourIndex() )
})
)
}
Issue is that when console.log done on hourIndex (which runs through an array) is going infinite loop.
The getHourIndex
function is:
getHourIndex () {
const headerData = this.initHours[this.hourIndex]
this.hourIndex++
console.log(this.hourIndex) /// this is what's telling me it's an infinite loop
return headerData
}
Any orientation about why is this doing this infinite loop (considering that hourIndex array has only 25 elements) will be appreciated.