I was reading a book on the plane and something interesting came to my mind that needs an answer. The length property of objects is a read/write value. Let's say, you've got an array that has 6 elements in it and you change its length to 10 as shown below.
var array = ["hello", "world", "daniweb"]; alert(array.length); // this will give you three array.length = 10; // Here is the line that changes the value of length alert(array.length); // this will give 10
Why would someone change the value of length property?
what is the advantage of doing that?