What is the purpose of `structuredClone()` in JavaScript?

JavaScript Developer Easy

JavaScript Developer — Easy

What is the purpose of `structuredClone()` in JavaScript?

Key points

  • `structuredClone()` creates a complete copy of an object
  • It uses the structured clone algorithm to handle complex data types
  • This method is useful for creating independent copies of objects for manipulation or storage

Ready to go further?

Related questions