This JavaScript example uses a for-in loop to list the properties of an object.
<!DOCTYPE html> <html> <head> <title>XoaX.net's Javascript</title> </head> <body> <script type="text/javascript" src="ForInLoopOnObjectProperties.js"></script> </body> </html>
var qMysteries = { sFirst:"The Resurrection", sSecond:"The Ascension", sThird:"The Descent of the Holy Spirit", sFourth:"The Assumption", sFifth:"The Coronation of Mary"}; for (sProp in qMysteries) { document.writeln(sProp + " : " + qMysteries[sProp] + "<br />"); }
© 20072024 XoaX.net LLC. All rights reserved.