This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes what's being returned from this code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "what Watch "what New topic

what's being returned from this code?

simon tiberius

Joined: Oct 30, 2012
Posts: 29

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

Joined: Jan 10, 2002
Posts: 63198

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.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: what's being returned from this code?
It's not a secret anymore!