Skip to content

Instantly share code, notes, and snippets.

@destroytoday
Created November 12, 2010 00:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save destroytoday/673487 to your computer and use it in GitHub Desktop.
Save destroytoday/673487 to your computer and use it in GitHub Desktop.
// the old, lame way
protected var _property:Property;
public function get property():Property
{
if (!_property)
{
_property = new Property();
}
return _property;
}
// the new, hip way
protected var _property:Property;
public function get property():Property
{
return _property ||= new Property();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment