Skip to content

Commit

Permalink
simplified index property
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosmaranje committed May 10, 2024
1 parent 3fc13c8 commit 336ea3b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/elements/Cell.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class Cell {
*/
constructor(cell) {
this.parent = cell.parentNode;
this.index = Array.prototype.indexOf.call(this.parent.children, cell);
this.index = Array.from(this.parent.children).findIndex((element) => element === cell);
this.siblings = new Siblings(this.parent, this.index);
}
}
Expand Down

0 comments on commit 336ea3b

Please sign in to comment.