get (obj, keyName) Object
public
Gets the value of a property on an object. If the property is computed, the function will be invoked. If the property is not defined but the object implements the unknownProperty
method then that will be invoked.
If you plan to run on IE8 and older browsers then you should use this method anytime you want to retrieve a property on an object that you don't know for sure is private. (Properties beginning with an underscore '_' are considered private.)
On all newer browsers, you only need to use this method to retrieve properties if the property might not be defined on the object and you want to respect the unknownProperty
handler. Otherwise you can ignore this method.
Note that if the object itself is undefined
, this method will throw an error.
Parameters:
-
obj
Object
- The object to retrieve from.
-
keyName
String
- The property key to retrieve
Returns:
-
Object
- the property value or `null`.
Please login to continue.