can.extend

  • function
 

Merge objects together.

can.extend(target, ...obj)

Parameters

  1. target {Object}

    The object to merge properties into.

  2. obj {Object}

    Objects containing properties to merge.

Returns

{Object}

target, post-merge.

can.extend(target, objectN) merges the contents of two or more objects together into the first object similarly to jQuery.extend.

var first = {},
second = {a: "b"},
third = {c: "d"};

can.extend(first, second, third); //-> first

first  //-> {a: "b", c: "d"}
second //-> {a: "b"}
third  //-> {c: "d"}