Skip to content

Instantly share code, notes, and snippets.

@tmshv
Created March 31, 2013 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmshv/5281869 to your computer and use it in GitHub Desktop.
Save tmshv/5281869 to your computer and use it in GitHub Desktop.
Action Script 3.0 Merging two objects;
package{
public function merge(object1:Object, object2:Object):Object {
var result:Object = {};
var i:String;
for (i in object1) {
result[i] = object1[i];
}
for (i in object2) {
if (result[i] == undefined) result[i] = object2[i];
}
return result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment