Skip to content

indexOf array of array partially working. #7389

@martiuh

Description

@martiuh

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    invalidIssues and PRs that are invalid.questionIssues that look for answers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions