Skip to content

Commit

Permalink
Change != to !== (#575)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
searls committed Aug 19, 2022
1 parent 0041bc2 commit 7b90498
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/handbook/05_managing_state.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default class extends Controller {

showCurrentSlide() {
this.slideTargets.forEach((element, index) => {
element.hidden = index != this.index
element.hidden = index !== this.index
})
}
}
Expand Down Expand Up @@ -166,7 +166,7 @@ export default class extends Controller {

showCurrentSlide() {
this.slideTargets.forEach((element, index) => {
element.hidden = index != this.indexValue
element.hidden = index !== this.indexValue
})
}
}
Expand Down Expand Up @@ -203,7 +203,7 @@ export default class extends Controller {

showCurrentSlide() {
this.slideTargets.forEach((element, index) => {
element.hidden = index != this.indexValue
element.hidden = index !== this.indexValue
})
}
}
Expand Down

0 comments on commit 7b90498

Please sign in to comment.