aboutsummaryrefslogtreecommitdiff
path: root/js/src/carousel.js
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2021-08-10 18:07:39 +0300
committerXhmikosR <[email protected]>2021-10-05 19:52:11 +0300
commit2b4d0d166b58cabfb0384a2081d84e51df84e37f (patch)
tree2798ad58c1131e68e7943b737efce006b86d1794 /js/src/carousel.js
parent9f1579aa048eb6a7dee30f60e5c2357b049eff3a (diff)
downloadbootstrap-2b4d0d166b58cabfb0384a2081d84e51df84e37f.tar.xz
bootstrap-2b4d0d166b58cabfb0384a2081d84e51df84e37f.zip
Enable `unicorn/no-for-loop` rule
Diffstat (limited to 'js/src/carousel.js')
-rw-r--r--js/src/carousel.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/js/src/carousel.js b/js/src/carousel.js
index 96812d3b6..322ad46a0 100644
--- a/js/src/carousel.js
+++ b/js/src/carousel.js
@@ -366,10 +366,10 @@ class Carousel extends BaseComponent {
const indicators = SelectorEngine.find(SELECTOR_INDICATOR, this._indicatorsElement)
- for (let i = 0; i < indicators.length; i++) {
- if (Number.parseInt(indicators[i].getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {
- indicators[i].classList.add(CLASS_NAME_ACTIVE)
- indicators[i].setAttribute('aria-current', 'true')
+ for (const indicator of indicators) {
+ if (Number.parseInt(indicator.getAttribute('data-bs-slide-to'), 10) === this._getItemIndex(element)) {
+ indicator.classList.add(CLASS_NAME_ACTIVE)
+ indicator.setAttribute('aria-current', 'true')
break
}
}
@@ -574,8 +574,8 @@ EventHandler.on(document, EVENT_CLICK_DATA_API, SELECTOR_DATA_SLIDE, Carousel.da
EventHandler.on(window, EVENT_LOAD_DATA_API, () => {
const carousels = SelectorEngine.find(SELECTOR_DATA_RIDE)
- for (let i = 0, len = carousels.length; i < len; i++) {
- Carousel.carouselInterface(carousels[i], Carousel.getInstance(carousels[i]))
+ for (const carousel of carousels) {
+ Carousel.carouselInterface(carousel, Carousel.getInstance(carousel))
}
})