返回一个 Boolean 值,指明枚举算子是否位于集合的末尾。
myEnum.atEnd()
必选项 myEnum 参数是任意 Enumerator 对象。
如果当前项是集合中的最后一个,或者集合为空,或者当前项没有定义,那么 atEnd 方法将返回 true 。否则返回 false 。
在下面的代码中,使用了 atEnd 方法来决定是否到达了一个驱动器列表的末尾:
function ShowDriveList(){
   var fso, s, n, e, x;
   fso = new ActiveXObject("Scripting.FileSystemObject");
   e = new Enumerator(fso.Drives);
   s = "";
   for (; !e.atEnd(); e.moveNext())
   {
      x = e.item();
      s = s + x.DriveLetter;
      s += " - ";
      if (x.DriveType == 3)
         n = x.ShareName;
      else if (x.IsReady)
         n = x.VolumeName;
      else
         n = "[Drive not ready]";
      s +=   n + "<br>";
   }
   return(s);
}
item 方法 | moveFirst 方法 | moveNext 方法
应用于: Enumerator 对象