Problem/Motivation
This issue similar to #3416898: Use String.prototype.includes() instead of String.prototype.indexOf() where necessary.
Some of Array.prototype.indexOf() is used to check a specific item is or isn't included within a array.
Proposed resolution
Use Array.prototype.includes().
This method is suitable for array item existence check.
Remaining tasks
User interface changes
No.
API changes
No.
Data model changes
No.
Release notes snippet
Issue fork drupal-3454079
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
tom kondaComment #4
smustgrave commentedComing from #3416898: Use String.prototype.includes() instead of String.prototype.indexOf() where necessary this change already seemed to be accepted so this seems fine.
Comment #5
nod_small detail
Comment #6
tom kondaI changed to simple else clause in my local environment, it seems to work correctly.
Comment #7
smustgrave commentedFeedback fron @nod_ appears to be addressed.
Comment #8
nod_Thanks for the update. When reviewing with the full context, it makes sense to have the else if, can you add it back please?
Comment #9
tom kondaI reverted else to else if.
Please review.
Comment #10
smustgrave commentedRevert was fine.
Comment #15
nod_Committed and pushed 0819b7aaf4 to 11.x and 530cf173e4 to 11.0.x and 6f61856980 to 10.4.x. Thanks!
Comment #16
tom konda10.4.x branch has tracker module.
In this module still have Array.prototype.indexOf() so need to fix it.
Comment #18
tom kondaFix remaining Array.prototype.indexOf() on the 10.4.x branch.
Please review.
Comment #19
smustgrave commentedLGTM!
Comment #20
nod_Thanks for the update, since it's pretty minor I'd rather not reopen this one, especially since the tracker module is out of 11.x
Comment #21
nod_Comment #22
nod_