posted 14 years ago
Hi All,
I have this confusion about creating javascript functions. Hope you could enlighten me out.
Say I created a named function:
So I can call it like this since named functions becomes the property of the global object which is the window object
Now, I have made some experiment to help me understand further.
Say I have this HTML.
test1.js has this code:
test2.js has this code:
Now here is where I got confused, when I run this code in firefox, firebug is telling me that sayHi is undefined.
I thought named functions are created before any code is executed. Also I thought only anonymous functions are created during the parsing of the script.
Can you help me out if I miss some basic concept?
Sean Clark ---> I love this place!!!
Me ------> I definitely love this place!!!