Set length for objects and arrays.