View Full Version : Is Function a data type,or an object ?

Code Wizard
05-04-2004, 07:06 PM
Well...what is it actually?
And is it true that for every declared function in the script,the interpreter automaticaly converts it to an object ?

05-04-2004, 07:18 PM
an object is a data type. a function is a kind of object.

Code Wizard
05-04-2004, 07:22 PM
I think it should of be more like this:
Is a function a separate data type from an object ?

05-04-2004, 08:41 PM
loosely, object is the super class. function is the sub class. a function is a kind of object.

05-04-2004, 09:25 PM
The Object prototype is the base prototype to which everything belongs. Function, Number, Array, Boolean, Null, Undefined, String, RegExp, Error prototypes do all inherit directly from the Object prototype.