Skip to content

Instantly share code, notes, and snippets.

@devboy
Created November 29, 2011 22:54
Show Gist options
  • Save devboy/1406991 to your computer and use it in GitHub Desktop.
Save devboy/1406991 to your computer and use it in GitHub Desktop.
var circle = { x: 10, y: 10, radius: 10 };
var rect = { x: 20, y: 20, width: 100, height: 100 };
function move( objectWithXAndY: { x: Int, y: Int } )
{
objectWithXAndY.x += 5;
objectWithXAndY.y += 5;
}
// both calls will work
move( circle );
move( rect );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment