JavaScriptには、コレクションを列挙する"for~in"構文があります。 これはC#のforeachや、Visual BasicのFor Eachに相当する素敵でラクチンな機能か……と思いきや。検索してみると、使用している事例を全く見かけません。 その理由(?)らしきものを調べたので、まとめておきます。 class Class1 { [STAThread] static void Main(string[] args) { string srcDoc = "<html><p>line1</p><p>line2</p><p>line3</p></html>"; XmlDocument doc = new XmlDocument(); doc.LoadXml( srcDoc ); XmlNodeList pCollection = doc.GetElementsByTagName("p