Phaser API Documentation

  Version: 
<static> Merge(obj1, obj2)

Description:

Creates a new Object using all values from obj1 and obj2. If a value exists in both obj1 and obj2, the value in obj1 is used.

This is only a shallow copy. Deeply nested objects are not cloned, so be sure to only use this function on shallow objects.

Parameters:

name type description
obj1 object

The first object.

obj2 object

The second object.

Returns:
Description:

A new object containing the union of obj1's and obj2's properties.

Type:
  • object
Since: 3.0.0
Source: src/utils/object/Merge.js (Line 9)