-
-
Notifications
You must be signed in to change notification settings - Fork 35.2k
Closed
Labels
invalidIssues and PRs that are invalid.Issues and PRs that are invalid.questionIssues that look for answers.Issues that look for answers.
Description
I don't know why is this happening but there's something wrong with indexOf when using array of arrays because it returns true even when the words partially match the word, here's an example
- Version 6.2.2:
- Platform 15.5.0 Darwin Kernel:
arr = [['abc'],['ABC']];
arr[0][0].indexOf('abc'); //returns 0
arr[0][0].indexOf('ab') //returns 0
arr[0][0].indexOf('a') //returns 0
arr[0][0].indexOf('abcd') //returns -1
arr[0][0].indexOf('ABC') //returns -1
// Simple array indexOf
arr = ['abc'];
arr.indexOf('a'); // returns -1
I'm not sure if this is an issue or it's just me not knowing how to use it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
invalidIssues and PRs that are invalid.Issues and PRs that are invalid.questionIssues that look for answers.Issues that look for answers.