Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hernan/5bba9e1716482fc180db to your computer and use it in GitHub Desktop.
Save hernan/5bba9e1716482fc180db to your computer and use it in GitHub Desktop.
# Little background about unknown properties
myObject = Ember.Object.create({name: 'hi'}) # a plain simple ember object
# so the property "name" is a known property for myObject, but any other properties which are not defined on this object are unknown properties
myObject.get("age") # age is an unknown property as we did not set "age" yet, the expression on the left evaluates to undefined
# Be careful ! only properties on the object that are not "set" yet are unknown properties but not the properties that evaluate to null/undefined
myObject.set("status", undefined) # although myObject.get("status") evaulates to undefined, status is a known property for myObject
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment