Returns the first item from an array.
arrayFirst(array)
→ returns any
array.first()
Use the member function to return the first item from an array
someArray = [1,2,3,4];
WriteOutput(someArray.first());
Expected Result: 1
Return the first item from an array
seinfeldArray = ["Jerry","Elaine","Kramer","George"];
WriteOutput(arrayFirst(seinfeldArray));
Expected Result: "Jerry"
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.