get()

Get the value of the specified property name.

This function is valid in v2.0.0 to v2.24.3. This function has been downloaded 62 times.

Parameters

{Object|undefined} obj
Object to get the property from.
{string|undefined=} opt_name Optional, Default:undefined
Name of the property.
{*=} opt_default Optional, Default:undefined
The default value to return if the specified property (opt_name) is not owned by obj.

Returns

{*}
If both obj and opt_name are specified then either the owned property will be returned or opt_default will be returned. If obj is undefined a partial function will be returned that will accept an object to always pull the same property name (opt_name) from and an optional different default value. If opt_name was not specified or is undefined a partial function will be returned that will accept a name for a property to always pull from the same object (obj) and a different default value.

Required Function

This function directly requires the following function which is included automatically:

  • has()
    Every object descended from Object inherits the hasOwnProperty method. This method can be used to determine whether an object has the specified property as a direct property of that object; unlike the in operator, this method does not check down the object's prototype chain.