он работает с ясным, но не начинается с нуля < /p>
Код: Выделить всё
const array = ["a1","a2","a3","a4","a5","a6","a7","a8","a9","a10","a11","a12","a13","a14","a15"]
let next = {
start: 0,
end: 0,
incrementby: 3,
inc() {
this.start = this.start = 0 ? 0 : this.start + this.incrementby;
this.end = this.start + this.incrementby;
console.log(this.start, this.end);
displayHadith(this.start,this.end)
},
};
function displayHadith(start,end) {
var container = document.querySelector(".container");
container.innerHTML = ""
let some = array.slice(start, end);
for (let element of some) {
container.innerHTML +=`
${element}
`
}
}< /code>
clickNext
Подробнее здесь: https://stackoverflow.com/questions/795 ... e-method-i