Class JUL.Ref

A class for working with references in JavaScript

Class Summary
Constructor Attributes Constructor Name and Description
 
JUL.Ref(oRef, sKey)
Creates a writable reference of a member of the given object

Method Summary

Class Detail

JUL.Ref(oRef, sKey)
Creates a writable reference of a member of the given object
Parameters:
{Object} oRef
The object to reference or a config object with 'ref' and 'key' properties
{String} sKey
The name of the member to reference

Method Detail

  • {Object} del()
    Applies JavaScript 'delete' operator on the referenced object member
    Returns:
    {Object} The reference itself
  • {String} key(sKey)
    Gets or sets the name of the referenced member
    Parameters:
    {String} sKey Optional
    The new name or index to set the member to. Omit to get the current one.
    Returns:
    {String} The name of the referenced member
  • {Mixed} ref(oRef, sKey)
    Gets or sets the referenced object or the name of the referenced member
    Parameters:
    {Object} oRef Optional
    The new object to reference. Omit to get the current object, set to true to get the property name
    {String} sKey Optional
    The new name of the member to reference
    Returns:
    {Mixed} The referenced object or member name if getting, nothing if setting
  • {Mixed} val(oVal)
    Gets or sets the value of the referenced member
    Parameters:
    {Object} oVal Optional
    The new value to set the member to. Omit to get the current value
    Returns:
    {Mixed} The value of the referenced member