# Typeof dynamic properties in object

**URL:** <https://forum.kirupa.com/t/typeof-dynamic-properties-in-object/313401>\
**Category:** Uncategorized\
**Created:** [August 28, 2010, 7:58pm UTC](https://forum.kirupa.com/t/typeof-dynamic-properties-in-object/313401 "2010-08-28T19:58:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![itworks](https://avatars.discourse-cdn.com/v4/letter/i/46a35a/32.png) [@itworks](https://forum.kirupa.com/u/itworks)\
**Post date:** [August 28, 2010, 7:58pm UTC](https://forum.kirupa.com/t/typeof-dynamic-properties-in-object/313401/1 "2010-08-28T19:58:39Z")

</div>

Hi,

I have a complex object with nested objects and arrays in it. I’ve made a clone function which makes a copy of it instead of a reference so I can keep the original one intact while i change the properties in the clone as such:

```auto

static public function clone (original:Object):* {
	var ba:ByteArray = new ByteArray();
	ba.writeObject(original);
	ba.position = 0;
	return ba.readObject();
}

```

All this is working fine so far but the problem is that all the nested arrays inside the object have a value type of object (since they’re dynamic). So lets say:

```auto

originalObject.someArray = ['apple', 'orange'];

trace(typeof(originalObject.someArray));

```

it traces “object”.

Any ideas on how I can have the object’s dynamic properties properly typed?

Thanks in advance.
