S
const newArr = [];
for (let i = 0; i < arr.length; i++) {
newArr.push(cb(arr[i], i, arr))
}
return newArr
}
Size: a a a
S
S
S
D
go
СМ
A
АК
V
AG
АК
АК
AG
V
V
V
await new Promise(res => setTimeout(res, 500))
IS
this.prev();
выдает ошибку.VS
IS
class Slider {
constructor(object) {
this.prevButton = object.prevButton;
this.nextButton = object.nextButton;
this.activeClass = object.activeClass;
this.images = object.images;
this.iterator = 0;
this.prevButton.onclick = function() {
this.prev();
}
this.nextButton.onclick = function() {
this.next();
}
}
prev() {
if (this.iterator <= 0) {
this.iterator = this.images.length - 1;
}
images[this.iterator].removeClass(this.activeClass);
images[--this.iterator].addClass(this.activeClass);
}
next() {
if (this.iterator >= this.images.length) {
this.iterator = 0;
}
images[this.iterator].removeClass(this.activeClass);
images[++this.iterator].addClass(this.activeClass);
}
};