File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Need explanation with javascript functions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Need explanation with javascript functions" Watch "Need explanation with javascript functions" New topic

Need explanation with javascript functions

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 751
Hi, I asked this a long time ago... I already forgot so I'm asking again...

How does

var myVar = myFunction();

differ from...

var myVar = myFunction;


SCJP 1.5
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Runs function and stores value into myVar
var myVar = myFunction();

Stores the function into the variable myVar
var myVar = myFunction;

You would be able to do

myVar(); and it will execute the function store in it.

I agree. Here's the link:
subject: Need explanation with javascript functions
jQuery in Action, 3rd edition