# Extending Array class

**URL:** <https://forum.kirupa.com/t/extending-array-class/309614>\
**Category:** Uncategorized\
**Created:** [May 19, 2010, 8:23pm UTC](https://forum.kirupa.com/t/extending-array-class/309614 "2010-05-19T20:23:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pier25](https://avatars.discourse-cdn.com/v4/letter/p/4af34b/32.png) [@Pier25](https://forum.kirupa.com/u/Pier25)\
**Post date:** [May 19, 2010, 8:23pm UTC](https://forum.kirupa.com/t/extending-array-class/309614/1 "2010-05-19T20:23:52Z")

</div>

After thinking about it for too long I finally decided to make my own array class!  
I was getting tired of doing array[array.length - 1] to get the last element of an array…

So far the class is working ok. I’ve got my getter/setter for the array.last property.

Now the thing is trace(array) is not displaying the usual array output. Basically the output window displays nothing…

Is there a solution to this? Or do I have to create my own trace method like array.trace() ?

Also is there a way to use my array class by default instead of the original array class? So that when I do var myArray = [] it creates an array with my class.

TIA
