Microsoft®
JScript for...in / for...of Statements |
Language Reference Version 1
|
Executes a statement for each element of an object or array.
for (variable in [object | array])
statementfor (variable of array)
statementThe for statement syntax has these parts:
Part Description variable In the for...in statement, a variable that can hold any of the elements of object or the name of an index in the array. The variable is a string, which is set to match each of the keys in the object.
In the for..of statement, variable is a number, which indexes the array. Note that it may not iterate the array in order.
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.
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.
See the continue Statement.
© 1997 by Microsoft Corporation. All rights reserved.
Comments:
file: /Techref/inet/iis/jscript/htm/js754.htm, 3KB, , updated: 2020/2/6 22:14, local time: 2024/9/1 02:30,
3.144.2.61:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://piclist.com/Techref/inet/iis/jscript/htm/js754.htm"> for...in Statement</A> |
Did you find what you needed? |
![]() o List host: MIT, Site host massmind.org, Top posters @none found - Page Editors: James Newton, David Cary, and YOU! * Roman Black of Black Robotics donates from sales of Linistep stepper controller kits. * Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters. * Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated! * Contributors: Richard Seriani, Sr. |
Welcome to piclist.com! |
.