SEW | Working with Objects
As a curious developer I want to learn about objects, so that I can use them in the right way.
- An object x is defined in a certain way, so that the statement console.log(x.y.z) prints 42 on the console.
As a curious developer I want to learn about objects, so that I can use them in the right way.
- An object v is defined in a certain way, so that the statement console.log(v.v().v) prints 42 on the console.
As a lazy developer I want to count members of an object easily, so that I can use them in the right way.
- A function numberMembers(obj) is available.
- The function returns the number of members (properties and methods) of obj.
As a lazy developer I want to compare the structure of two objects easily, so that I can be sure about them.
- A function equals(obj1, ob2) is available.
- The function returns true, if obj1 and obj2 are equal.
- The objects are equal if
- they have the same number of members
- if they both have members with the same name
- The order of the members does not matter