Merge
  • 18 May 2022
  • 1 Minute to read
  • Dark
    Light
  • PDF

Merge

  • Dark
    Light
  • PDF

Article Summary

Given a list of objects, returns a single object that contains all unique key/value pairs from the source objects. If there are several objects that have the same key, the value will be taken from the last object in the list.

Function signature

MERGE(objects: Array) => Object
ParameterDescription
ObjectsList of objects whose properties will be get

Examples

dog = {"name":"dog","weight":123,"a":1}
cat = {"name":"cat","weight":48,"b":2}
rat = {"name":"rat","weight":10,"c":3}
FormulaReturn value
MERGE([dog, cat, rat]){"a":1,"b":2,"c":3,"name":"rat","weight":10}
MERGE([]){}

Was this article helpful?

What's Next