---
schema_version: "1"
id: a32f629e4173a467a00d4d2a461b67892c2e3879be9e18e850f05c30d0a0a8ff
title: Use enhancedDeepClone in a Custom LWC (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/ind/264-0-0/comms_use_enhanceddeepclone_in_a_custom_lwc.md
canonical_url: https://help.salesforce.com/s/articleView?id=ind.comms_use_enhanceddeepclone_in_a_custom_lwc.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ee14d436b6ac27f4061cbe24a8f36c068399452630a52f8604891aa8d7570510
description: Use the enhancedDeepClone() utility function in your custom Lightning web component (LWC) to create a modifiable copy of read-only JavaScript objects. This function also supports copying objects created directly within your LWC, providing flexibility for your data manipulation tasks.
products:
  - Communications
release: "264"
---
# Use enhancedDeepClone in a Custom LWC (Managed Package)

Use the `enhancedDeepClone()` utility function in your custom Lightning web component (LWC) to create a modifiable copy of read-only JavaScript objects. This function also supports copying objects created directly within your LWC, providing flexibility for your data manipulation tasks.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
        <colgroup>
          <col style="width:50%">
          <col style="width:50%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d49056e74">Required User Permissions</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Required User Permissions" class="slds-cell-wrap" style="vertical-align:top;" headers="d49056e74 ">To configure Lightning web components:</td>

            <td class="slds-cell-wrap" style="vertical-align:top;" headers="d49056e74 ">Communications Cloud Admin</td>

          </tr>
        </tbody>
      </table>

![Managed Package Icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-ind-communications-264-0-0-production-enus/444efb86-ea1e-477e-afbc-56eaac192eaf/communications/images/media_package_icon.png) _This feature is part of the Communications Cloud managed package._

1. Import `enhancedDeepClone` from the `c/b2bUtils` library.
    
    ```
    import enhancedDeepClone from 'c/b2bUtils';
    ```
2. Call the function to create a modifiable copy of your read-only data.
    
    You can also use this function to copy objects created within your LWC.
    
    ```
    let newModifiableObject = enhancedDeepClone(readOnlyData);
    ```