Whenever you see something you don't recognize, that just might be part of
Javascript you didn't know about, try checking with one of the Javascript
reference sites. I'm sure there are a few opinions which is 'best', but I
just check the Mozilla site, such as searching for "mdn javascript foreach"
with Google which gets you to Array.prototype.forEach()
<https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach?redirectlocale=en-US&redirectslug=JavaScript%2FReference%2FGlobal_Objects%2FArray%2FforEach>
But what you have cited seems to be missing a callback reference, like
list.foreach( function(file){
if file.ext = ext then {
console.log(item[i]
}
});
Can you look at that "official answer" again?
On Monday, February 2, 2015 at 2:00:42 PM UTC-6, Roelof Wobben wrote:
>
> Hello,
>
> I doing exercises of nodeschool.
>
> I have to filter some data in a list so I did
>
> ~~~
>
> for (var i=0, i < list.length , i++ ) {
>
> if file.ext = ext then {
> console.log(print item[i]
> }
> }
>
> but in the official solution I see this :
>
> ~~~
>
> List.foreach {
> if file.ext = ext then {
> console.log(item[i]
> }
> }
>
> ~~~
>
> where can I find more info on the list properties ?
>
> Roelof
>
>
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/d4eba874-0903-4623-b7fb-579df3e2b0e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.