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

203
Views
Difference in time complexity of toString and join of array

Is there any difference in time complexity between [1,2,3].toString() and [1,2,3].join() . As I understand time complexity of join function is O(n) . What is the time complexity of .toString() method ?

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

0

Both have the same time complexity. Array.prototype.toString calls Array.prototype.join without argument. ',' is the default separator.

MDN Spec

about 4 years ago · Juan Pablo Isaza Report

0

toString() has the same time complexity of join(), the difference is that with join() is possible to choose the separator.

array.join([separator]);

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!