The above example var oproperty; The variables must be declared for a for-in loop.
for (oproperty in history) reveals that the history of each property of the object to be accepted as an alternate oproperty variables.
document.write (oproperty); Oproperty the browser to display the values of variables have been issued.
var i; A second for the for-in loop variables must be declared.
var name = new Array (); Through an array has been created, which will be adopted as the variable name.
name  = “Karim”; name  = “Rahim”; name  = “Manik”; name  = “Abdullah”; The Array material has been published.
for (i in name) revealed that the name of each element of the array as the variable i will be taken periodically.
document.write (name [i] + “<br />”); The element of the array of variable values as I have been asked to display the browser.
document.write(“<h2>Example of for-in loop </h2>”);
document.write(“<h2>History Object Properties </h2> “);
for (oproperty in history)
document.write(“<h2>for-in loop in array </h2> “);
var name = new Array();
name = “Karim”;
name = “Rahim”;
name = “Manik”;
name = “Abdullah”;
for (i in name)
document.write(name[i] + “<br />”);
Notepad: to open a file type from the menu at the top of layer code by clicking on the Save as File name: index.html, Save as type: All files, save and open the index.html file with the Mozilla Firefox look like the image shown below.
Example of for-in loop
History Object Properties