Meaningless Drivel is fun!
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
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
It's not a secret anymore!