Skip to content

Function_evisit_core_js_data_extend

Wyatt Greenway edited this page Jan 31, 2017 · 3 revisions

function extend([flags[, args...]])

Parameters

  • flags [optional]
    • (Object) >>> Will be considered the first of args
    • (Boolean) If true this is a deep copy
    • (Number) This is a bitwise combination of flags. Flags include: evisit-core-js.data.extend.DEEP, evisit-core-js.data.extend.NO_OVERWRITE, and evisit-core-js.data.extend.FILTER. If the 'FILTER' flag is specified the 2nd argument is expected to be a function to assist in which keys to copy
  • args... [optional]
    • (Object) >>> Objects to copy into base object. First object in the argument list is the base object.
    • (Function) >>> If the second argument is a function and the bitwise flag "FILTER" is set then this function will be the callback used to filter the keys of objects during copy

Return value

  • (Object) Base object with all other objects merged into it

Description

Extend (copy) objects into base object. This should ALWAYS be used instead of jQuery.extend because it is faster, and more importantly because it WILL NOT mangle instantiated sub-objects.


Clone this wiki locally