getWithDefault (obj, keyName, defaultValue) Object
public
Retrieves the value of a property from an Object, or a default value in the case that the property returns undefined
.
Ember.getWithDefault(person, 'lastName', 'Doe');
Parameters:
-
obj
Object
- The object to retrieve from.
-
keyName
String
- The name of the property to retrieve
-
defaultValue
Object
- The value to return if the property value is undefined
Returns:
-
Object
- The property value or the defaultValue.
Please login to continue.