chain()

Creates a chained version of a value.

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

Parameter

{*=} value Optional
Value to make chainable.

Returns

{YourJSChain}
A YourJSChain object allows for chaining other YourJS functions calls together and thusly all of its functions except the value() function will return a YourJSChain object. You can call the YourJSChain's value() function to return the actual internal value. The YourJSChain's end() function will return the previous YourJSChain object.

Required Functions

This function directly requires the following functions which are included automatically:

  • forIn()
    Runs through all of the properties of an object, executing a function for each property found.
  • 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.
  • is()
    Tests to see if two or more values are exactly the same. This is similar to === but will also indicate that NaN is NaN and will indicate that -0 is not 0.
  • mixin()
    Adds a new function to the YourJS object and to YourJSChain's prototype.
  • slice()
    Slice does not modify the original array, but instead returns a shallow copy of elements from the original array.
  • typeOf()
    Either gets the type of a value or adds a constructor registering its custom type name.

Requiring Function

This function is directly required by the following function:

  • mixin()
    Adds a new function to the YourJS object and to YourJSChain's prototype.