# Is there a way to return all of an Object's variables?

**URL:** <https://forum.kirupa.com/t/is-there-a-way-to-return-all-of-an-objects-variables/318662>\
**Category:** flash\
**Created:** [January 26, 2011, 7:05pm UTC](https://forum.kirupa.com/t/is-there-a-way-to-return-all-of-an-objects-variables/318662 "2011-01-26T19:05:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![screeg](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@screeg](https://forum.kirupa.com/u/screeg)\
**Post date:** [January 26, 2011, 7:05pm UTC](https://forum.kirupa.com/t/is-there-a-way-to-return-all-of-an-objects-variables/318662/1 "2011-01-26T19:05:02Z")

</div>

I want to assign an existing Object all the vars of a prototype Object, without a direct reference. One way to do this is:

```auto
var protoObject = {nom:"Bruce",age:111}
var enObj:Object;

enObj.nom = protoObject.nom; enObj.age = protoObject.age;

```

This way both Object’s values for .nom and .age can be independently changed, but it’s tedious.

Is there an automated way to assign all of protoObject’s vars to enObj?
