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

184
Views
What is the time complexity of object spread operator in Javascript?

I found that there are some QAs about spread operator time complexity but those are all for array.

Is the spread operator time complexity same for object?

a = { ...b }

What is the time complexity of the above statement if the key count of b is N?

is it O(N)?

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

0

It's O(n). Object spread iterates through all enumerable own properties and assigns them to a new object, and property assignment is an O(1) process. If there are N keys to iterate through, there are around N such operations to perform.

That said, this here will not be a bottleneck in 99.9% of actual code, so it's not worth worrying about.

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!