How to add an element at the end of an array in ColdFusion

ArrayAppend() - add an element at the end of an array


<!DOCTYPE html>

<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ArrayAppend function example: how to add element at the end of an array</title>

<h2 style="color:Green">ArrayAppend Function Example</h2>

<cfset ColorArray = ArrayNew(1)>
<cfset Temp=ArrayAppend(ColorArray,"AliceBlue")>
<cfset Temp=ArrayAppend(ColorArray,"AntiqueWhite")>
<cfset Temp=ArrayAppend(ColorArray,"Aqua")>
<cfdump var="#ColorArray#" label="Color Array">
<br />

<b>Now Append: Aquamarine</b>
<br />
<cfset Temp=ArrayAppend(ColorArray,"Aquamarine")>
<cfdump var="#ColorArray#" label="Color Array">


More ColdFusion examples