Question 540
Before adopting Object type to define a fixed schema of named attributes with declared types, which statement sets an accurate boundary?
Explanation
Correct Answer
For Object type in the task to define a fixed schema of named attributes with declared types, the important caution is: It is distinct from a map requiring the same element type for all values. The reason this matters is its actual behavior: object({...}) gives each named property a type, allowing heterogeneous fields.
Incorrect Answers
The proposed warning belongs to Type conversion function, which serves the different goal to convert a collection into a set before using for_each, rather than to Object type: toset(...) converts suitable values into a set, removing duplicates from a list input. The question concerns Object type acting to define a fixed schema of named attributes with declared types, not a limit of Type conversion function.
The proposed warning belongs to Optional object attribute, which serves the different goal to allow an object input to omit a field with an optional type specification, rather than to Object type: optional(TYPE, DEFAULT) supports an omitted object attribute and can supply a default value. The question concerns Object type acting to define a fixed schema of named attributes with declared types, not a limit of Optional object attribute.
The proposed warning belongs to Tuple type, which serves the different goal to describe a fixed sequence with independently typed positions, rather than to Object type: tuple([...]) declares the expected type at each list position. The question concerns Object type acting to define a fixed schema of named attributes with declared types, not a limit of Tuple type.