+ 4

Which is more efficient from below?

var abc = document.getElementById(""); for(a=b) for(a=b) var abc = document.getElementById("");

22nd Apr 2018, 11:50 AM
Madhuri Bhamare
2 Respostas
+ 4
reason please
22nd Apr 2018, 11:53 AM
Madhuri Bhamare
+ 2
the first one. Your for loop is faulty but still the second one is lower because it needs to find your element every time.
22nd Apr 2018, 11:51 AM
Toni Isotalo
Toni Isotalo - avatar