Skip to content

Commit 7b90498

Browse files
authored
Change != to !== (#575)
Use the [strict inequality](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Strict_inequality) operator instead of the looser one that will convert operands to compare them. Just saw this and thought I'd share because strict equality/inequality is generally preferred and recommended.
1 parent 0041bc2 commit 7b90498

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/handbook/05_managing_state.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export default class extends Controller {
5757

5858
showCurrentSlide() {
5959
this.slideTargets.forEach((element, index) => {
60-
element.hidden = index != this.index
60+
element.hidden = index !== this.index
6161
})
6262
}
6363
}
@@ -166,7 +166,7 @@ export default class extends Controller {
166166

167167
showCurrentSlide() {
168168
this.slideTargets.forEach((element, index) => {
169-
element.hidden = index != this.indexValue
169+
element.hidden = index !== this.indexValue
170170
})
171171
}
172172
}
@@ -203,7 +203,7 @@ export default class extends Controller {
203203

204204
showCurrentSlide() {
205205
this.slideTargets.forEach((element, index) => {
206-
element.hidden = index != this.indexValue
206+
element.hidden = index !== this.indexValue
207207
})
208208
}
209209
}

0 commit comments

Comments
 (0)