Web Effects for...in Statement
For...in declarations are used to iterate over the properties of an array or object.
The code in the for ... in loop performs an operation on the elements of the array or the properties of the object every time it executes.
Grammar:
For (variable in object)
{
Executing code here
The variable is used to specify the variable, and the specified variable can be an array element or an object's property.
var dictionary = new Array ();
dictionary["Cheron"] = "Xielongbao";
dictionary["Zhou Paotri"] = "zhoubaocui";
Dictionary["Xie both"] = "Xiexiaoyue";
Alert (dictionary["Cheron"]);
Alert (dictionary. Cheron);
for (var key in dictionary) {
Alert ("Key:" +key+ "value:" +dictionary[key]);
}
Dynamic array
var Myarr = new Array ();
Myarr[0] = 1;
MYARR[1] = 2;
MYARR[2] = 3;
MYARR[3] = 23;
MYARR[4] = 11;
A dynamic array is the length of an unknown group, and the new array above defines an array of unknown length and then assigns a value.