Welcome, Guest. Please Login
 
  HomeHelpSearchLogin FAQ Radified Ghost.Classic Ghost.New Bootable CD Blog  
 
Page Index Toggle Pages: 1
Send Topic Print
Programming | objects vs properties & functions vs methods (Read 1791 times)
Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Programming | objects vs properties & functions vs methods
Oct 9th, 2011 at 6:35pm
 
my javascript book talks about the global object saying:

the global object defines an initial set of properties that include:

1. global properties (such as undefined, Infinity and Nan)
2. global functions (such as isNan(), parseInt() and eval()
3. constructor functions [such as Date(), RegExp(), String(), Object() and Arrat() ]
4. global objects (such as Math and JSON)

My questions:

re #4 > why arent these called "global propertes" .. since they are "attached" to the global object?

re: #2 & 3 > whya arent these called "methods" .. since they are also "attached" to the global object.

also > why are the items listed in #1 called "properties" while those in #4 called "objects" .. when BOTH are "attached" to the global object.

I use the word "attached" i quotes cuz I'm not sure of the precise terminology I should be using here.
 
WWW  
IP Logged
 

Rad
Radministrator
*****
Offline


Sufferin' succotash

Posts: 4090
Newport Beach, California


Back to top
Re: Programming | objects vs properties & functions vs methods
Reply #1 - Oct 9th, 2011 at 6:49pm
 
to make matters worse, if you look up the global object in the Reference section of the book, they list the constructors with/under the "global functions" (along with Math & JSON) .. not with the "global functions" as one might expect.

(there IS NO separate category for "Constructors".)

I'm trying to form categories in my mind and the terminology used here seems confusing, no?
 
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print