dispatchany type of value and the disadvantage is that you lose the specialized methods and features built into other Units for a specific data structure, for example, we can store an
arrayvalue in a GenericUnit, but we cannot use methods like
setto add items to the value without a manual
dispatch. Also, we lose the assurance that the value would always be of a specific data type, i.e.: an
arrayin case of ListUnit.
toStringto make working with the stored value a bit easier, when you call these methods they are called on the stored value instead of GenericUnit instance.
entries, and implements them as instance members
objectEntries, respectively. These methods do not throw an error on
nullvalue, they would simply return an empty array instead.