ArrayFindAll

Return an array containing the indexes of matched values

Method Signature

ArrayFindAll(array=[array], value=[any])

Arguments

Argument
Type
Required
Description
Default

array

array

true

The array to be searched.

value

any

true

The value to found.

Examples

Script Syntax

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" );
writeDump( applePositions );

Result: [1,3].

Additional Examples

Run Example

fruitArray = [ 
	"apple",
	"kiwi",
	"banana",
	"orange",
	"mango",
	"kiwi"
];
favoriteFruits = arrayFindAll( fruitArray, "kiwi" );
dump( favoriteFruits );
 // [2]

Last updated

Was this helpful?