🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #184

Using for ... in with arrays

#184
From: Dave_Saunders
Date: Tue, 31 Mar 2009 14:44
15 lines
993 bytes
Is it obvious to everybody that:

var myArray = [3,4,5] 
for (j in myArray) { 
  $.writeln(j); 
}

produces in the JavaScript Console:

0
1
2
Execution finished.

I stumbled on a script yesterday that I wrote a while back that used this technique for iterating through an array but I had to step back and try this test to convince myself that it actually works.
Technical Details
Message-ID: <59b87616.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!newshub.sdsu.edu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,709551d954315a95,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: Dave_Saunders@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!newshub.sdsu.edu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: Using for ... in with arrays
Message-ID: <59b87616.-1@webcrossing.la2eafNXanI>
Date: Tue, 31 Mar 2009 07:44:25 -0700
Lines: 13
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit