Enumerator.moveFirst()

JScript3.0+Syntax

							enumeratorobj.moveFirst()

Description

The moveFirst() method of the Enumerator object moves the enumerator to the beginning of the collection. If the collection is empty or undefined, undefined is returned.

Example

In Listing 9.44, the enumerator is used to access the drive letters and types. The moveFirst() method moves the enumerator back to the beginning of the collection so the drive status can be determined for each drive.

Listing 9.44 Moving the Enumerator to the Beginning of the Collection
 <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); ...

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.