Using javascript console of Google Chrome Developer tool, for example, it will be possible to inspect global object like Math.
You can simple write Math in your console and then return.
You will be able to access all properties like E, PI and methods like abs, ceil, etc.
Also String is a global object like Math, but if you try the same operation, the javascript condole output will be different and you will be not able to see Properties and Methods.
In order to see Properties and Methods of String you need to make something like this.
var c = new String("asd")
And then inspect the c objet.
So my question is, can you make an example of very simple objects implemented as String and then as Math?
In regular OO Math would be seen as a
Staticclass, there is only one instance of it. String would be a normal class, where you create more then one instance.As for javascript; you can make an object with values as functions:
You can call Calc.Addition(1,2) and get 3 back.
In the other sample, where you have to instantiate the object first you could have something like this:
In your console log you’d see p has a property called Name, and a function called Walk.