04-25-2009, 06:12 PM
|
#19 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Location: Denmark
Posts: 352
Thanks: 8
|
Quote:
Originally Posted by allworknoplay
Yeah you threw a new one at me...
I will go ahead and read up on Mootools....I'll go with your suggestion and hope in the process the fundamentals of JS don't escape me...
|
This one is similar to foreach, except its written the other way around:
javascript Code:
for(c in ['Hello', 'World']) { alert(c); }
Arrays or objects to iterate are set on the right side, unlike foreach in PHP where its on the left side. The following example would looks like this in php:
PHP Code:
foreach(Array('Hello', 'World') as $c)
{
echo($c);
}
__________________
|
|
|