import * as esriLang from "@arcgis/core/core/lang.js";
const esriLang = await $arcgis.import("@arcgis/core/core/lang.js");
@arcgis/core/core/lang
Provides a utility method for deeply cloning objects with properties that are computed or have their own clone() method, such as
Extent.
Method Overview
| Name | Return Type | Summary | Object |
|---|---|---|---|
Use this method to deeply clone objects with properties that are computed or have their own | lang |
Method Details
-
clone
Methodclone(elem){Object} -
Use this method to deeply clone objects with properties that are computed or have their own
clone()method. For example, if you are creating an object that stores an initial extent and a spatial reference for your application, you can useesriLang.clone(initialProps)to clone this object so that theextentandspatialReferenceare properly cloned.Parameterelem ObjectThe object to be cloned.
ReturnsType Description Object A clone of the object. Exampleconst esriLang = await $arcgis.import("@arcgis/core/core/lang.js"); let initialProps = { extent: appExtent, // app initial extent spatialReference: spatReference // app spatialReference }; // Creates a deep clone of the object let clonedInitialProps = esriLang.clone(initialProps);