• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what's being returned from this code?

 
simon tiberius
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I'm confused, the code doesn't see to return integer or object or whatever, so what's the purpose of "return" in the snippet? thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65216
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm assuming this is in a jQuery environment?

If so, then the outer function will return the value returned by the .each() method, which, if you look at the jQuery docs, will be the same jQuery wrapped set that .each() is called upon.

In other words: the value of this on line 3.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic