Function
merge (original, updates) Object public deprecated
Module:
@ember/polyfills
Defined in packages/@ember/polyfills/lib/merge.ts:9
import { merge } from '@ember/polyfills'; |
- original
- Object
- The object to merge into
- updates
- Object
- The object to copy properties from
- returns
- Object
Merge the contents of two objects together into the first object.
1 2 3 4 5 6 |
import { merge } from '@ember/polyfills'; merge({ first: 'Tom' }, { last: 'Dale' }); // { first: 'Tom', last: 'Dale' } var a = { first: 'Yehuda' }; var b = { last: 'Katz' }; merge(a, b); // a == { first: 'Yehuda', last: 'Katz' }, b == { last: 'Katz' } |