[android-components](../../index.md) / [mozilla.components.support.ktx.android.org.json](../index.md) / [org.json.JSONObject](index.md) / [mergeWith](./merge-with.md)

# mergeWith

`fun `[`JSONObject`](https://developer.android.com/reference/org/json/JSONObject.html)`.mergeWith(other: `[`JSONObject`](https://developer.android.com/reference/org/json/JSONObject.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) [(source)](https://github.com/mozilla-mobile/android-components/blob/master/components/support/ktx/src/main/java/mozilla/components/support/ktx/android/org/json/JSONObject.kt#L84)

Merge the contents of another [JSONObject](https://developer.android.com/reference/org/json/JSONObject.html) with this object,
overwriting the colliding keys.

### Parameters

`other` - the [JSONObject](https://developer.android.com/reference/org/json/JSONObject.html) providing the data to be
    merged with this one.