chain()

Creates a chained version of a value.

This function is valid in v2.7.0 to v2.13.3. This function has been downloaded 39 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 requires the following functions which are 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.
  • 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.
  • forIn()
    Runs through all of the properties of an object, executing a function for each property found.
  • typeOf()
    Either gets the type of a value or adds a constructor registering its custom type name.
  • 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.