Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubyStruct and DataSingle-choice MCQ

A Data type is defined and an instance is created. What happens when you attempt to mutate one of its values?

Point = Data.define(:x, :y) p = Point.new(x: 1, y: 2) p.instance_variable_set(:@x, 99)