ESM: import * as esriLang from "@arcgis/core/core/lang.js";
CDN: const esriLang = await $arcgis.import("@arcgis/core/core/lang.js");
Object: @arcgis/core/core/lang
Since: ArcGIS Maps SDK for JavaScript 4.0
Provides a utility method for deeply cloning objects with properties that are computed or have their own clone()
method, such as Extent.
Use this method to deeply clone objects with properties that are computed or have their own clone()
method.
clone(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 use esriLang.clone(initialProps)
to clone this object so that the extent
and spatialReference
are properly cloned.
Returns
Type Description Object A clone of the object.Example
const 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);
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4