amol rajhans Posted December 11, 2019 Share Posted December 11, 2019 Hello There, As I was going through your documentation of W3C for javascript. I would like to suggest one change in documentation. As per your Javascript documentation of https://www.w3schools.com/js/js_performance.asp (Reduce Activity in Loops) Bad code is as follows: var i; for (i = 0; i < arr.length; i++) { Better Code: var i;var l = arr.length; for (i = 0; i < l; i++) { But in URL (https://www.w3schools.com/js/js_htmldom_elements.asp) >> Finding HTML Elements by HTML Object Collections. In this example: var x = document.forms["frm1"]; var text = ""; var i;for (i = 0; i < x.length; i++) { text += x.elements.value + "<br>";}document.getElementById("demo").innerHTML = text; From above example the highlighted line should be replaced with Better code. Also after filling form for Report Error on page https://www.w3schools.com/js/js_htmldom_elements.aspand when i click on submit below API gives me error like API : https://www.w3schools.com/err_sup.asp "We cannot find the page you are looking for.It might have been removed, had its name changed, or is temporarily unavailable. Please check that the Web site address is spelled correctly." Please let me know, if I could help you here. Regards, Amol Rajhans Link to comment Share on other sites More sharing options...
Ingolme Posted December 13, 2019 Share Posted December 13, 2019 Unfortunately, the staff rarely visits the forums. As far as taking length calls out of the loop, it's a negligible performance impact in 99% of situations. If you were writing a heavy time-critical application this would be one of the optimizations you could do to improve it if you find that it's running slow. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now