Enumerator.moveNext()

JScript3.0+Syntax

							enumeratorobj.moveNext()

Description

The moveNext() method of the Enumerator object moves the enumerator to the next element in the collection. If the collection is empty, undefined is returned.

Example

The moveNext() method is used in Listing 9.45 to move the enumerator to the next drive in the collection.

Listing 9.45 Move to the Next Drive Using moveNext()
 <html> <H1>Drive Letters and drive types:</H1> <script language="JScript"> <!-- Hide //Create enumerator object var fileSysObj = new ActiveXObject("Scripting.FileSystemObject"); var en = new Enumerator(fileSysObj.Drives); //Display drive letter and type for each drive. for (;!en.atEnd();en.moveNext()) { document.write("Drive ",en.item().DriveLetter); ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.