Now,back to the original topic.
It's quite amazing how JS treats most things as objects,in fact,each data type that can't be defined by the language's standard data types,is treated as an object.
I would even go to say that everything in JS is an object...(well,umm almost).
When you see a "string",there you have an object,an array is a data type defined by an object(in fact,in old JS implementations you had to define your own array object,it wasn't implemented by default);
Everything that has visual impact on the page you handle with objects,even the primitive data types can be viewed as objects - as they have their own wrapper objects.
Even when writing:
you can think of objects ,as x is now a property of the window object.Code:var x=2564;
This leads to the conclusion that JS is not Object-Oriented,it is object based(as stated in a previous post).
That's just coz objects have a much greater role than in other languages.
What were trying to do is emulate some concepts that can be found in OO languages(Polymorphism,Encapsulation,Data hiding,Inheritance ...)
So,for how many of these can we say that we have an alternative in JS?
(When you come to think about it,seeing the list of words reserved for future use,it's all clear that we'll be having classes,public,private members and so on...heh,so in any future JS implementation,all this thing about closures would be of no use)