Assume we have an object defined as below

peter = new record()
peter.name = "Peter"
peter.age = 36
peter.mark = 78


Suppose Susan was the same age as Peter and had scored the same marks. Could we define her like this?

susan = peter
susan.name = "Susan"

As you can see from the answer below the is no. Objects work in the same way as Java.



More java script examples