ArrayToStruct

Transform the array to a struct, the index of the array is the key of the struct

Returns: struct

Usage

ArrayToStruct( array )

Arguments

Argument Description
array
(array, required)

array to translate

Examples

Simple Array

arr = ['a','b','c','d','e','f','g'];
dump(arrayToStruct(arr));

//member function
dump(arr.toStruct());

Array of Structs

arr = [
    {name:'a'},
    {name:'b'},
    {name:'c'},
    {name:'d'},
    {name:'e'}
];
dump(arrayToStruct(arr));

//member function
dump(arr.toStruct());

See also