Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the time complexity of JavaScript methods? [closed]

Is there any resource to know the time complexity of natively defined array and string methods in JavaScript? I have to do guess work while I am using them to solve algorithm, but I want to be sure about what is the time complexity of those functions?

like image 700
Ankit Kumar Avatar asked Oct 27 '22 20:10

Ankit Kumar


1 Answers

This question has been answered previously:

Time Complexity for Javascript Methods in V8

In short, it's not specified and the time complexity for common JS methods can differ between browsers.

Worse yet, some methods might not even exist or will behave differently between different browsers and browser versions!

like image 160
kyle Avatar answered Nov 15 '22 11:11

kyle