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

What does this Data.define example print?

Point = Data.define(:x, :y) p1 = Point.new(x: 1, y: 2) p2 = p1.with(y: 9) p p1.to_h p p2.to_h p p1.frozen?