StructNew

Creates a new struct of the specified type.

The available types are:

  • casesensitive

  • default

  • ordered-casesensitive

  • ordered

  • soft

  • sorted

  • weak

Method Signature

StructNew(type=[string], sortType=[any], sortOrder=[string], localeSensitive=[any], callback=[function:Comparator])

Arguments

Argument
Type
Required
Description
Default

type

string

false

The struct type

default

sortType

any

false

An optional sort type to apply to that type

sortOrder

string

false

The sort order applicable to the sortType argument

asc

localeSensitive

any

false

false

callback

function:Comparator

false

An optional callback to use as the sorting function. You can alternatively pass a Java Comparator.

Examples

New struct using literal notation

Creates an unordered struct.

Run Example

New struct using function

Creates an unordered struct.

Run Example

New ordered struct using literal notation

CF2016+ Creates an ordered struct. Note the square brackets.

Run Example

New ordered struct using function

Creates an ordered struct.

Run Example

New ordered struct using literal notation

Creates an ordered struct.

New case-sensitive struct using function

CF2021+ Creates a case-sensitive struct.

Run Example

New case-sensitive struct using literal notation

CF2021+ Creates a case-sensitive struct.

New ordered and case-sensitive struct using function

CF2021+ Creates a case-sensitive struct.

Run Example

New ordered and case-sensitive struct using literal notation

CF2021+ Creates an ordered and case-sensitive struct.

Additional Examples

Last updated

Was this helpful?