ColdFusion arrayMap #2


Lanjutan dari tulisan sebelumnya di Loop Array menggunakan ArrayEach, kali ini aku coba posting live demonya di youtube

<!---
ColdFusion arrayMap function
--->

<cfscript>
	
arr = ["a", "b", "c"];

writeDump(arr);

arrayMap(arr, function(item, index, array) {

	// item in the array
	writeOutput("item : " & item);

	writeOutput("&nbsp;&nbsp;");

	// index of the array
	writeOutput("index : " & index);

	// a copy of the original array, changes to this array will not be reflected in the original array
	array[index] = "updated value, original item is : #item#";

	cfdump (var=array, label="dump of copy of array 'arr', index #index#", format="text");

});

</cfscript>

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: