From 2b432e4f1f1b62222b60ec4b20fd406dfda1acf5 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Wed, 23 Nov 2022 12:34:11 +0100 Subject: [PATCH] Add reference to `structuredClone` --- foomo/docs/frontend/typescript/spreading.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foomo/docs/frontend/typescript/spreading.md b/foomo/docs/frontend/typescript/spreading.md index bb8b168..6a68390 100644 --- a/foomo/docs/frontend/typescript/spreading.md +++ b/foomo/docs/frontend/typescript/spreading.md @@ -7,7 +7,7 @@ JavaScript spread syntax `(...)` is a surprisingly powerful construct. It has tw Spreading creates new instances of objects or array, but we need to be very careful because it only does a shallow copy. If you have a deeply nested object or array, nested entities will still hold a reference to an original value and hence dangerous bugs can occur. -Copying is needed when doing state changes (either local or state management e.g. Redux). +Copying is needed when doing state changes (either local or state management e.g. Redux). If deep cloning is required [`structuredClone`](https://developer.mozilla.org/en-US/docs/Web/API/structuredClone) can be used. ```jsx live function () {