Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

JScript for. . . in Statement

Executes a statement for each element of an object or array.

Syntax: JScript for. . . in Statement

for (variable in [object | array])

statement

Arguments: JScript for. . . in Statement

variable

A variable that can hold any of the elements of object.

object, array

An object or array over which to iterate.

statement

The statement to be executed for each member of object. Can be a compound statement.

Remarks: JScript for. . . in Statement

Before each iteration of a loop, variable is assigned the next element of object. You can then use it in any of the statements inside the loop exactly as if you were using the element of object.

When iterating over an object, there is no way to determine or control the order in which the members of the object are assigned to variable.

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.