H
Size: a a a
H
VD
M
M
AE
VK
AE
AE
VK
AE
AE
VK
AE
class CarouselModel {
_currentIndex = 0;
_countIndex = null;
constructor(countIndex) {
if (typeof countIndex !== 'number') throw new
ErrorError('Not a number');
this._countIndex = countIndex;
}
getIndexCount() {
return this._countIndex;
}
getCurrentIndex() {
return this._currentIndex;
}
setCurrentIndex(index) {
this._currentIndex = index;
}
getIndexBeforeCurrent() {
return this.getCurrentIndex() === 0 ? this.getIndexCount() : this.getCurrentIndex()-1;
}
getIndexAfterCurrent() {
return this.getCurrentIndex() === this.getIndexCount() ? 0 : this.getCurrentIndex()+1;
}
}
AE
AE
DZ
AE
NK
AN
т