JavaScript, Forgive me for posting it here

M

msdn

I know this is not a JavaScript group. Direct me to the right place if you
get offended

Question:

Does anyone know exactly what does code below mean or do.

var AZ = Function.AZ = function(someVar){...}

Thanks,

Sa
 
L

Laurent Bugnion

Hi,
I know this is not a JavaScript group. Direct me to the right place if you
get offended

Question:

Does anyone know exactly what does code below mean or do.

var AZ = Function.AZ = function(someVar){...}

Thanks,

Sa

A function in JavaScript is an object, the reference to a function can
be stored in a variable. The code above creates a function and stores a
reference to it in the local AZ variable, and also one in Function.AZ.
Function is an existing class, and in JavaScript, you can add properties
to existing classes dynamically.

After this code is executed, you can call the function by calling

AZ( someVar );

or

Function.AZ( someVar );

HTH,
Laurent
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top