# Return array elements

**URL:** <https://forum.kirupa.com/t/return-array-elements/175202>\
**Category:** Uncategorized\
**Created:** [January 12, 2006, 3:23pm UTC](https://forum.kirupa.com/t/return-array-elements/175202 "2006-01-12T15:23:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chapster](https://avatars.discourse-cdn.com/v4/letter/c/958977/32.png) [@chapster](https://forum.kirupa.com/u/chapster)\
**Post date:** [January 12, 2006, 3:23pm UTC](https://forum.kirupa.com/t/return-array-elements/175202/1 "2006-01-12T15:23:28Z")

</div>

I have a Queue class set up that holds different arrays that have been passed into the Queue.  
there is a array in the Queue class called data that holds all the arrays that have been passed in.

I’m trying to set up a function called trace that traces out the arrays and there elements.

example:

```auto

data=[["element 1","element 2","element 3"],["element 1","element 2"],["element 1"]];

```

I want this to trace out like

```auto

output:
["element 1","element 2","element 3"],["element 1","element 2"],["element 1"]

```

function I wrote

```auto

	public function trace():String{
		for(var i =0; i < data.length; i++){
			var elements="["+data*+"]";
			}
			return elements;
		}

```

This function will only give me the last array in the array

Anyone know how I can get this trace to work
