Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
Why doesn't structuredClone copy Function Object?

MDN says that "Function objects cannot be duplicated by the structured clone algorithm; attempting to throws a DataCloneError exception."

Why does copying a function object emit an error with structuredClone()?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

If you read on MDN/structuredClone, it says

Exceptions

DataCloneError DOMException

  • Thrown if any part of the input value is not serializable.

For why functions are not serializable, see here: Why is a function not serializable?

From what I understand of those answers, the TL;DR is that it's because a function can be converted to a string, but the variables/functions referenced in the function that are out of scope would cause issues.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!