Searches an array for all positions of a specified value. The function searches for simple values such as strings and numbers or for complex objects such as structures. When the second parameter is a simple value, string searches are case-sensitive

arrayFindAllNoCase(array, value or callback) → returns array

Member Function Syntax

someArray.findAllNoCase(value or callback)

Argument Reference

array array

The source array to search through

value or callback variableName

If string, case insensitive value to search for; if callback, use signature function (item, index, array) : boolean

Sample code invoking the arrayFindAllNoCase function

Find the positions of a given string within a provided array regardless of case.

var fruitArray = ['apple','banana','apple','orange','kiwi'];
var applePositions = arrayFindAllNoCase(fruitArray, 'APPLE');

Expected Result: [1,3].

Fork me on GitHub